必知1
因?yàn)镻erl 十分簡(jiǎn)潔图仓,所有有很多的黑魔法亮元。下面這些東西是你一定要知道的渐排。
可以忽略屈暗,但是大項(xiàng)目的時(shí)候必須要培養(yǎng)的意識(shí)
- use strict; use warnings;
- END and =cut =head 來(lái)寫(xiě)注釋(POD 格式)
Perl 要關(guān)注的論壇和 Perl 一些牛人(持續(xù)更新):
論壇:
China Unix
Perl Monks
Perl 大牛:
szabgab.com : 這個(gè)網(wǎng)站是那個(gè)大牛的集合性的網(wǎng)站
perl maven.com 網(wǎng)站是這個(gè)網(wǎng)站的持續(xù)性的網(wǎng)站
Perl 三部曲
小駱駝 --> 中駱駝 --> 大駱駝
注意:如果你只是要做一些生物信息的話,不想深入的去了解Perl 的話屏富,看完小駱駝就夠了晴竞!
關(guān)于造輪子的問(wèn)題:
perl 自己就有很多的輪子,就是那些自帶的核心Perl模塊狠半。在這些模塊中也有一些神器噩死,可以利用颤难。
** Perl 自帶的模塊與Perl 神器**
首先說(shuō) Perl 的神器:
- Perl::Tidy : Many people say perl code is really ugly and give is a name "write-only language". OK here you can get a method to customolize your code or others' code to let the codes you interest be much more tidy.
- Perl::Critic : advice for your code.
- Smart::Comments : A really smart comments. you can control your code to be the comments or debuging your scripts. It's worthwhile to study it.
Perl 自帶的核心模塊
P.S. 比自己寫(xiě)的好太多了!
List::Util : This module inclues the most common functons such as sum,max. You don't need to constrct the repeat wheels. Note: the functions here is modified by the C, so I suppose your code is not run as fast as he. And also, if you think it's not enough, than you can go to: List::MoreUtils
Data::Dumper : see the complex data structure. An alternative way is to enter the dubug mode (perl -d), than use
x $var
to see the structure.**Getopts::std : ** Easily get the options
use Getopt::Std;
getopts('i:o:p:');
our($opt_i, $opt_o, $opt_p);
my $inputfile = $opt_i;
my $outputfile = $opt_o;
my $parameter_value = $opt_p || "20";
print "$_\n" for $inputfile, $outputfile, $parameter_value;
- Diagnostic和Crap
用來(lái)追蹤錯(cuò)誤