我有一堆脚本,我想重构成模块。这是我第一次做这样的事情。我在线阅读,Module :: Starter似乎是创建新模块的首选方式之一。但是,在开发过程中,我应该如何使用其他不相关脚本中的模块?我不希望每次修改它时都构建/安装每个模块。此外,我应该如何在同一目录中分发带有模块的脚本? (即,我想在同一个tar球中分发一个带有Foo :: Bar和Foo :: Baz的应用程序script.pl,我希望'perl script.pl'能够正常工作,特别是在草莓上工作。任何提示?
> module-starter --module=Foo::Bar
Created Foo-Bar
Created Foo-Bar/lib/Foo
Created Foo-Bar/lib/Foo/Bar.pm
Created Foo-Bar/t
Created Foo-Bar/t/pod-coverage.t
Created Foo-Bar/t/pod.t
Created Foo-Bar/t/manifest.t
Created Foo-Bar/t/boilerplate.t
Created Foo-Bar/t/00-load.t
Created Foo-Bar/ignore.txt
Created Foo-Bar/Makefile.PL
Created Foo-Bar/Changes
Created Foo-Bar/README
Created Foo-Bar/MANIFEST
Created starter directories and files
> perl -MFoo::Bar -w -e ''
Can't locate Foo/Bar.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .).
BEGIN failed--compilation aborted.
答案 0 :(得分:0)
使用PERL5LIB环境变量添加要包含在Perl模块搜索中的目录:
导出PERL5LIB = / somedir