flow02:/home/tomcat> cat tmp.out
1.1.1.1
flow02:/home/tomcat>
flow02:/home/tomcat>
flow02:/home/tomcat> cat a2.pl
open (LOG ,"<","tmp.out");
while (<LOG>) {
chomp;
$var=$_;
$hash{$var}++;
};
while(my($ip, $times) = each %hash) {
print "$ip access count(*) == $times\n";
};
flow02:/home/tomcat> perl a2.pl
1.1.1.1 access count(*) == 1
flow02:/home/tomcat> >tmp.out
flow02:/home/tomcat> cat tmp.out
flow02:/home/tomcat> perl a2.pl
flow02:/home/tomcat>
perl hash 累加
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
下一篇:【奇技淫巧】
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Perl hash map操作,定义,插入,删除,hash函数
perl
perl map