
Perl
文章平均质量分 59
wenchenzhao113
为今天比昨天进步一点而努力奋斗
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
perl study note-1
#!/usr/bin/perl -wuse strict;# two ways to print meta-char# qq: qq can be followed by any symbol pairs, such as: //,||,{}print "$ @ ";pri原创 2008-05-05 15:33:00 · 449 阅读 · 0 评论 -
Perl: Filesystem analysis and traversal
leave a tap原创 2010-03-23 12:03:00 · 338 阅读 · 0 评论 -
perl: non-buffered write
select($file); $|=1;# for now, write to file without buffered. issue:printing something to STDOUT will write in file instead of display of STDOUT.原创 2010-03-05 17:27:00 · 364 阅读 · 0 评论 -
perl: system interaction
The following topics will be covered. Exit value;system & exec - block the present process & swith to a new process, wait for them to finish before returning to next.capture output原创 2009-12-20 15:14:00 · 567 阅读 · 0 评论 -
perl: regular expression
1. work on $_ by default i.e. it will work on $_ if we dont give any vars;while ({ print if m/leo/; print s/leo/LEO/; # print number of matches foun原创 2009-12-09 22:04:00 · 732 阅读 · 0 评论 -
perl: read in files in several ways
#!/opt/VRTSperl/bin/perl -wuse strict;my $file = shift;print "==================read file line by line/n";read_file("$/", $file);print "==================read the whole file at one time/n";原创 2009-12-09 16:07:00 · 507 阅读 · 0 评论 -
Perl中使用shell命令
#!/usr/bin/perl -wuse strict;my @arr = `cat /etc/llthosts | awk {print /$2}`; #perl中使用shell命令,注意,$应该转义,否则perl会将$2解释为一个变量原创 2009-11-16 16:20:00 · 625 阅读 · 0 评论 -
网络上的一道题目(1)
1.考虑一个字符串替换的过程,在一个文本文件中含有一些文本内容和一些需要替换的变量,变量的格式为“$Var$”,原来的“$”使用“$$”进行转义,原来的“$$”表示为“$$$”。我们将含有变量的文件称为模板(文件名为t),文本文件的平均长度为100K。另外,还有一系列的变量文件,里面为变量名和变量值的对应关系(文件名为1.v , 2.v…n.v),每个变量文件包含的变量数在百万数量原创 2009-10-22 15:04:00 · 376 阅读 · 0 评论 -
Regular Expression
1. /^[a-z]+/d+$/begin with one or more lower chars [a-z], end with one or more digital numbers. 2. /^([a-z]+(/d)+)+$/the pattern above is repeated more than once.原创 2009-07-06 17:04:00 · 336 阅读 · 0 评论 -
perlnote4
#!/usr/bin/perl -wuse strict;=headthis section describe hash;=cut=head11 define: my %[a-zA-Z_]str; the name begin with a-zA-Z_, digit is denied; pair原创 2008-06-23 10:40:00 · 288 阅读 · 0 评论 -
perlnote3
#!/usr/bin/perl -wuse strict;=head11 condition: false when value is 0/null string/string with "0" value/undef;2 block: {}; vars only take effect in the block they are defined;3 c原创 2008-06-23 10:39:00 · 325 阅读 · 0 评论 -
perl study note-2
#!/usr/bin/perl -wuse strict;=head11 condition: false when value is 0/null string/string with "0" value/undef;2 block: ...{}; vars only take effect in the block they are defined;3 compare operator原创 2008-05-06 13:37:00 · 490 阅读 · 0 评论 -
perlnote7
#!/usr/bin/perl -wuse strict;=head this section describes file system;=cut=head11 test operators 2 built-in subroutines chdir "directory" or die "$!"; chdir; ===原创 2008-06-23 10:46:00 · 290 阅读 · 0 评论