##用到的函数opendir DIRHANDLE, EXPR # To open a directoryreaddir DIRHANDLE # To read a directoryrewinddir DIRHANDLE # Positioning pointer to the beginingtelldir DIRHANDLE &...【阅读全文】
# Installationcurl -kL http://install.perlbrew.pl | bash# Initializeperlbrew init# Pick a preferred CPAN mirrorperlbrew mirror# See what is availableperlbrew available# Install some Perlsperlbrew install 5.18.2perlbrew install perl-5.8.1perlbrew install perl-5.19.9# See what were install...【阅读全文】
问题说明:假设有文件夹data,里面含有很多.TXT域名的文件,而文件里有特定字符需要匹配,并输出该行。#!/usr/bin/perl -wuse strict;opendir IN,"data" || die "can't open : $!\n";open OUT,">>outfile";my @file=grep (/\.TXT/,readdir IN);foreach my $list(@file){ open TWO,"data/$list" o...【阅读全文】
The hash %SIG contains signal handlers for signals.-- SIG 是一个公用的存储信号的一个哈希变量点击(此处)折叠或打开[myang@mnsdev13:~/demo]$ cat sig.pl#!/usr/local/bin/perl5$SIG{TERM} = $SIG{INT} = \&yoursub ;$i = 1;...【阅读全文】