- or download this
#!/usr/bin/perl -w
use String::Util 'trim';
...
print "$_ ";
}
close CMD;
- or download this
[root@localhost Perl_Ping]# ./sample2.pl -h 192.168.1.150
$count is : 5
...
--- 192.168.1.150 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 11.150/11.150/11.150/0.000 ms
- or download this
[root@localhost Perl_Ping]# ping 192.168.1.150 -c 5
PING 192.168.1.150 (192.168.1.150) 56(84) bytes of data.
...
--- 192.168.1.150 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 2.072/2.134/2.187/0.055 ms