|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Perl : code on ping showing difference result
Hi all, I am using the below code to ping a code and print whehter the connection is successful or not. Code:
use Net::Ping;
$p = Net::Ping->new();
my $host = "x.x.x.x";
# print "$host is alive.\n" if $p->ping($host);
if ($p->ping($host,3))
{
print "success";
}
else
{
print "Fail";
}
$p->close();For one IP address.. I received the status as "Fail" . But when tried using start->run-> cmd ->ping ipaddress .. the ping is successful. COuld you let me know any other alternative code to ping the device. ---------- Post updated at 06:57 AM ---------- Previous update was at 06:50 AM ---------- Hi all, I am using the below code to ping a code and print whehter the connection is successful or not. Code:
use Net::Ping;
$p = Net::Ping->new();
my $host = "x.x.x.x";
# print "$host is alive.\n" if $p->ping($host);
if ($p->ping($host,3))
{
print "success";
}
else
{
print "Fail";
}
$p->close();For one IP address.. I received the status as "Fail" . But when tried using start->run-> cmd ->ping ipaddress .. the ping is successful. COuld you let me know any other alternative code to ping the device. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ps command showing full code of running script | rajeevra | Shell Programming and Scripting | 2 | 05-28-2012 08:41 AM |
| solaris link aggregation problem , once i reboot it is not showing, not able to ping the default gat | buildscm | Solaris | 2 | 01-18-2012 09:14 AM |
| Ping and Perl | ab52 | Shell Programming and Scripting | 1 | 08-14-2011 07:46 AM |
| Help with showing the difference in two lines of input | Kweekwom | Shell Programming and Scripting | 12 | 02-14-2008 06:16 PM |
| defined value not showing....in the result | happyv | Shell Programming and Scripting | 1 | 01-26-2007 03:58 AM |
|
|