Chinaunix首页 | 论坛 | 博客
  • 博客访问: 931375
  • 博文数量: 245
  • 博客积分: 11429
  • 博客等级: 上将
  • 技术积分: 2662
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-15 00:16
文章存档

2011年(56)

2010年(174)

2009年(15)

分类: Python/Ruby

2011-07-22 17:52:54

perl]# cat ping.pl
#!/usr/bin/perl -w
use Net::Ping;
$p=Net::Ping->new("icmp");
open(P,"iplist")||die;
while(

){
    ($name,$ip)=split(/\s/,$_);
    $a=0;
    print $ip;
    for($i=0;$i<100;$i++){
        $p->ping($ip,1)?{$a++,print "!"}:print ".";
    }
    print ("$name\t$a%\n");
}
Close P;
[root@jzlf

阅读(1125) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~