如何创建多模块分发?

时间:2013-05-13 17:58:49

标签: perl perl-module cpan

我想创建自己的Perl模块,但问题是它包含多个.pm文件。结构是:

lib
├── A_Z.pm
└── T_test
    ├── A.pm
    ├── B.pm
    ├── C.pm
    ├── D.pm
    └── E.pm

我使用了h2xs -XA -n T_test::A T_test::B T_test::C T_test::D T_test::E。它仅编译A.pm;其他B.pmC.pmD.pmE.pm未被考虑。是否有任何解决方案可以同时执行所有.pm文件?

2 个答案:

答案 0 :(得分:3)

改为使用Module::Starter::PBP

$ module-starter --builder=Module::Build --module=A_Z,T_test::{A,B,C,D,E}
Added to MANIFEST: Build.PL
Added to MANIFEST: Changes
Added to MANIFEST: lib/A_Z.pm
Added to MANIFEST: lib/T_test/A.pm
Added to MANIFEST: lib/T_test/B.pm
Added to MANIFEST: lib/T_test/C.pm
Added to MANIFEST: lib/T_test/D.pm
Added to MANIFEST: lib/T_test/E.pm
Added to MANIFEST: MANIFEST
Added to MANIFEST: README
Added to MANIFEST: t/00.load.t
Created starter directories and files

$ tree A_Z
A_Z
├── Build.PL
├── Changes
├── lib
│   ├── A_Z.pm
│   └── T_test
│       ├── A.pm
│       ├── B.pm
│       ├── C.pm
│       ├── D.pm
│       └── E.pm
├── MANIFEST
├── README
└── t
    └── 00.load.t
3 directories, 11 files

答案 1 :(得分:0)

你不需要做任何特别的事情。只需确保所有文件都像往常一样列在MANIFEST中。 ExtUtils :: MakeMaker和Module :: Build都认为所有.pm都是要安装的模块。