

星标【科研日精进】,任何时候打开,我都带着热乎的科研干货,在最显眼的地方等你~

Perl是一门优秀的编程语言,广泛用于生物信息的脚本编写中,Perl中的@INC包括了所有的模块查找路径,我们可以通过不同的方法来对@INC进行修改,达到使用不同的Perl中的模块的目的。
查看方法
$ perl -V...@INC:/root/perl5/lib/perl5/x86_64-linux-thread-multi/root/perl5/lib/perl5/usr/local/lib64/perl5/usr/local/share/perl5/usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl/usr/lib64/perl5/usr/share/perl5
1. 使用特点模块
在脚本起始可以声明模块路径
##!/usr/bin/perl#use lib "/opt/mylib";use strict;use warnings;..
2. 在命令行中使用-I 参数
perl -I /opt/mylib script.pl
3. 在脚本起始使用-I 参数
#!/usr/bin/perl -I /opt/mylib#use strict;use warnings;..
4. 使用脚本直接修改@INC
#!/usr/bin/perl#BEGIN {unshift(@INC, "/opt/mylib");}use strict;use warnings;
5. 修改环境变量 PERL5LIB
> export PERL5LIB=/opt/special/mylib

![]() | ![]() | ![]() | |
![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |

文章转载自科研日精进,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
























