Subject: | Host name should not include any spaces |
ping function returning undef if the host name has a trailing space.
Sample code :
use Net::Ping;
my $ping_obj = Net::Ping->new();
my $status = 0;
my $host = 'solbox603 '; #Host has a trailing space
$status = 1
if ($ping_obj->ping($host));
$ping_obj->close();
print "\n:$status:\n";
#
# This code always prints 0
#
Distribution Name : Net-Ping-2.36
Perl version : v5.8.5 built for i386-linux-thread-multi
Operating System :
Linux ******** 2.6.9-55.0.0.0.2.ELsmp #1 SMP Wed May 2 14:59:56 PDT 2007
i686 i686 i386 GNU/Linux