今天配置一个简单的系统,遇到了找不到包,但是这些包的确又是安装正确的了。比较了一下两个INC值发现了一个奇怪的问题。
同是运行的Perl为什么会出现不同的包搜索路径呢?
[deon@b75 catalyst_devel]$ script/smde_server.pl
Can't locate Catalyst.pm in @INC (@INC contains: /home/deon/catalyst_devel/script/../lib /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .) at /home/deon/catalyst_devel/script/../lib/SMDE.pm line 27.
BEGIN failed--compilation aborted at /home/deon/catalyst_devel/script/../lib/SMDE.pm line 27.
Compilation failed in require at script/smde_server.pl line 49.
[deon@b75 catalyst_devel]$ perl -V
%ENV:
PERL5LIB=""
@INC:
/usr/local/lib/perl5/5.8.8/i686-linux
/usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl
.
原因没有找到,只想了一个办法来修复了。其它的问题留给高手去解决吧。
export PERL5LIB=$PERL5LIB:/usr/local/lib/perl5/site_perl/5.8.8
把perl的路径加到搜索里面去。
同是运行的Perl为什么会出现不同的包搜索路径呢?
[deon@b75 catalyst_devel]$ script/smde_server.pl
Can't locate Catalyst.pm in @INC (@INC contains: /home/deon/catalyst_devel/script/../lib /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .) at /home/deon/catalyst_devel/script/../lib/SMDE.pm line 27.
BEGIN failed--compilation aborted at /home/deon/catalyst_devel/script/../lib/SMDE.pm line 27.
Compilation failed in require at script/smde_server.pl line 49.
[deon@b75 catalyst_devel]$ perl -V
%ENV:
PERL5LIB=""
@INC:
/usr/local/lib/perl5/5.8.8/i686-linux
/usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl
.
原因没有找到,只想了一个办法来修复了。其它的问题留给高手去解决吧。
export PERL5LIB=$PERL5LIB:/usr/local/lib/perl5/site_perl/5.8.8
把perl的路径加到搜索里面去。