这有点简单,不过却够你想半天。
以下是我的命令行拷贝,请各位帮我看看为什么不对。
G:\work\perl>type tt.pl
use Net::Ping;
$host="61.128.128.68";
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
G:\work\perl>ping 61.128.128.68
Pinging 61.128.128.68 with 32 bytes of data:
Reply from 61.128.128.68: bytes=32 time<10ms TTL=252
Reply from 61.128.128.68: bytes=32 time<10ms TTL=252
Reply from 61.128.128.68: bytes=32 time=10ms TTL=252
Reply from 61.128.128.68: bytes=32 time=11ms TTL=252
Ping statistics for 61.128.128.68:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 11ms, Average = 5ms
G:\work\perl>perl tt.pl
G:\work\perl>
为什么我使用tt.pl这个程序后没有报告我说这个站点活着。
G:\work\perl>type tt.pl
use Net::Ping;
$host="61.128.128.68";
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
G:\work\perl>ping 61.128.128.68
Pinging 61.128.128.68 with 32 bytes of data:
Reply from 61.128.128.68: bytes=32 time<10ms TTL=252
Reply from 61.128.128.68: bytes=32 time<10ms TTL=252
Reply from 61.128.128.68: bytes=32 time=10ms TTL=252
Reply from 61.128.128.68: bytes=32 time=11ms TTL=252
Ping statistics for 61.128.128.68:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 11ms, Average = 5ms
G:\work\perl>perl tt.pl
G:\work\perl>
为什么我使用tt.pl这个程序后没有报告我说这个站点活着。
...全文
相关推荐
appletree-开源
这是一个简单的小程序框架,可以帮助你开发一个高性能的小程序。 它包含一些易于使用的功能,例如与 servlet 通信、swing 多线程等。
Z-Blog AppleTree模板
Z-Blog AppleTree模板
AppleTree:Applescript,应用程序,服务,Droplet,Action和Automator工作流在这棵苹果树上蓬勃发展,这是我制造的水果,而许多则来自Web Tut和利他主义者工蜂
苹果树 applescripts,apps和automator工作流在这棵Apple Tree上蓬勃发展,这是我的果实,而其他一些则来自Web tut和利他主义者工蜂
苹果树留言板(A) v1.3_appletree(毕设 + 课设).zip
苹果树留言板(A) v1.3_appletree(毕设 + 课设)
[聊天留言]苹果树留言板(B) v1.1_appletree_b.zip
[聊天留言]苹果树留言板(B) v1.1_appletree_b.zip


