这有点简单,不过却够你想半天。

silicon_crystal silicon_crystal 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
以下是我的命令行拷贝,请各位帮我看看为什么不对。

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这个程序后没有报告我说这个站点活着。
...全文
评论 7
收藏 已收藏
分享
返回顶部
silicon_crystal
CGI 2,203 成员 4,518 内容