⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 110_icmp_inst.t

📁 source of perl for linux application,
💻 T
字号:
# Test to make sure object can be instantiated for icmp protocol.# Root access is required to actually perform icmp testing.BEGIN {  unless (eval "require Socket") {    print "1..0 \# Skip: no Socket\n";    exit;  }}use Test;use Net::Ping;plan tests => 2;# Everything loaded fineok 1;if (($> and $^O ne 'VMS' and $^O ne 'cygwin')    or ($^O eq 'MSWin32'        and !IsAdminUser())    or ($^O eq 'VMS'        and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/))) {  skip "icmp ping requires root privileges.", 1;} elsif ($^O eq 'MacOS') {  skip "icmp protocol not supported.", 1;} else {  my $p = new Net::Ping "icmp";  ok !!$p;}sub IsAdminUser {  return unless $^O eq 'MSWin32';  return unless eval { require Win32 };  return unless defined &Win32::IsAdminUser;  return Win32::IsAdminUser();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -