之前曾简单的写/改写过几个Perl脚本,现在又碰到一个Perl写的脚本,于是先快速学习一下 Perl的相关知识。
搜索关键字:
- perl 快速 学习
- perl 教程
- perl tutorial
- Perl 打印字符串
- Perl 注释
- Can’t locate Net/LDAP.pm in @INC #AOL&Baidu搜索
在Linux下如何安装在Perl脚本里用到的模块?
Can’t locate Net/LDAP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./xxx.pl line 40.
BEGIN failed–compilation aborted at ./xxx.pl line 40.
方法一:直接yum search/install试试
$ perl -MCPAN -e shell Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .). BEGIN failed--compilation aborted. $ sudo yum search perl-CPAN Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ============================================= N/S Matched: perl-CPAN ============================================== perl-CPAN.x86_64 : Query, download and build perl modules from CPAN sites perl-CPANPLUS.x86_64 : API & CLI access to the CPAN mirrors Name and summary matches only, use "search all" for everything. $ sudo yum search perl-LDAP Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ============================================= N/S Matched: perl-LDAP ============================================== perl-LDAP.noarch : LDAP Perl module Name and summary matches only, use "search all" for everything.
方法二:CPAN或源码编译安装
The scripts outputs “Can’t locate Net/SNMP.pm in @INC…..”
You don’t have Net::SNMP installed, see below
How do I install Net::SNMP perl module ?
There are 2 ways of doing this
1) By CPAN (best)
on command line, as root :
[your_host]# perl -MCPAN -e shell cpan shell -> CPAN exploration and modules installation (v1.76) ReadLine support enabled cpan> install Net::SNMP If it's the first time you run CPAN, it will probably ask you some (simple) questions. CPAN will also ask you to satisfy some dependencies (Crypt::DES, Digest::MD5, etc..).
2) “By hand”
Get the folowings modules (tar.gz format) on www.cpan.org
– Crypt::DES
– Digest::MD5
– Digest::SHA1
– Digest::HMAC
– Net::SNMP
for each one (you must install Net::SNMP at the end) :
tar zxf <module>.tar.gz cd <module> perl Makefile.pl make test make install
参考链接:
- Perl中文手册 #Nice
- Perl教程
- Perl 基本语法 #Nice
- 两个半小时学会Perl #Nice
- =
- Perl Tutorial Hub
- 为 Java 程序员准备的 10 分钟 Perl 教程
- 学习Perl笔记(一)
- perl 快速学习记录 #Nice
- =
- Regular expressions in Perl #Nice
- perlre – perldoc.perl.org
- Perl 101 – Regexes
- Perl tutorial: String matching
- =
- http://stackoverflow.com/questions/161872/hidden-features-of-perl #Nice
- =
- http://cn.perlmaven.com/quoted-interpolated-and-escaped-strings-in-perl
- =
- http://www.cnblogs.com/xianghang123/archive/2011/07/07/2099898.html
- http://azaleasays.com/2008/05/27/perl-multi-line-comments/
- =
- http://www.itbulu.com/perl-time-hires.html #直接yum安装
- http://blog.chinaunix.net/uid-8116903-id-334694.html
- http://nagios.manubulon.com/faq.html #推荐!
- =
- https://github.com/GDSSecurity/PadBuster