perl 中 ping的小用法

前端之家收集整理的这篇文章主要介绍了perl 中 ping的小用法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
 use Net::Ping;

 $pinghost = Net::Ping->new("tcp");
#Protocol for ping must be "icmp","udp","tcp","syn","stream",or "external"
 $domain = "sohu.com";
 $ip = "184.22.37.92";

# if ($pinghost->ping('184.22.37.92')){
 if ($pinghost->ping($domain)){
 print "active.\n";
 } else
 {
 print "inactive.\n";
 }

 $pinghost->close();


perl ping-> 主机

http://hi.baidu.com/835094561/blog/item/b8b88d3f855f65e655e72371.html


perl ping检测脚本

http://baiqiuyi.com/perl/perl-ping-icmp-monitor.html



ping一段网络的perl脚本

http://www.byywee.com/page/M0/S227/227137.html

猜你在找的Perl相关文章