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 累加
最新推荐文章于 2022-07-19 16:53:49 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)