On 27 April 2012 17:47, Oeschey, Lars (I/ET-83, extern) <extern.lars.oesc...@audi.de> wrote: > > > I would try one of Net::DNS::Resolver, gethostbyname, > > Net::hostent:gethost > > or ?? to convert the alias to an IP addr - kinda depends on where the > > alias gets resolved - who the heck knows the correlation between the > > alias name and the IP addr and maybe that needs to be changed (eg: > > propagated to a name server or added to each computer's hosts file). > > Ok, this gets weird... I did a gethostbyname before the ping, and it still > doesn't work: > > my $packedip = gethostbyname($pinghost); > if (defined $packedip) { > $ip_address = inet_ntoa($packedip); > print $ip_address; > } > > my $p = Net::Ping->new(); > if (!$p->ping($ip_address)) { > print "\ncan't reach $ip_address: no network? Exiting!\n"; > print "\nPress any key to continue..."; > ReadMode('cbreak'); > my $key = ReadKey(0); > ReadMode('normal'); > exit; > } > > The ip adress that it gives me just pings fine in the DOS-Box...
Try the different protocols in the constructor, e.g: Net::Ping->new("icmp"); I do remember the above working for me on Windows a while back. Just in _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs