use strict; use warnings; use CGI; use Win32::PingICMP; my $q = new CGI; my %info; foreach my $param ($q->param){ $info{$param} = $q->param($param);} print $q->header(); my $JSCRIPT; my $p = Win32::PingICMP->new(); if ($p->ping($info{ipaddress})) { $JSCRIPT= "alert(\"Ping Successful for " . $p->details->{host} . " +\");\n";} else{ $JSCRIPT = "alert(\"Ping unsuccessful: " . $p->details->{status} . + "\");\n";} $JSCRIPT.= "window.location=\"subnet.pl?subnetid=$info{subnetid}&statu +s_id=$info{status_id}\";"; print $q->start_html(-script => $JSCRIPT); print $q->end_html();
In reply to Win32::PingICMP returns odd results by tbone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |