2010-12-09 70 views
0

我有一堆我想重构成模块的脚本。这是我第一次做这样的事情。我在线阅读并且Module :: Starter似乎是创建新模块的首选方法之一。但在开发过程中,我应该如何使用其他不相关脚本中的模块?我不想每次修改时都建立/安装每个模块。此外,我应该如何在同一目录中分发带有模块的脚本? (也就是说,我想用Foo :: Bar和Foo :: Baz在同一个tar文件夹中分发一个应用程序script.pl,并且我希望'perl script.pl'可以正常工作,特别是在草莓上)。任何提示?在perl中,如何在同一目录中使用使用模块启动器创建的模块?

> 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

添加要包括在使用PERL5LIB环境变量的Perl模块搜索目录:

出口PERL5LIB =/somedir

相关问题