It's nothing to do with gethostbyname() not working on Windows, there IS an important file missing from your system - you will get the same behaviour on Unix:
[root@orpheus jonathan]# perl -e 'use Net::Ping; $p = Net::Ping->new()
+;'
[root@orpheus jonathan]# mv /etc/protocols /etc/protocols.bak
[root@orpheus jonathan]# perl -e 'use Net::Ping; $p = Net::Ping->new()
+;'
Can't get tcp protocol by name at -e line 1
[root@orpheus jonathan]#
If you want to test this then create a file called 'protocols' int %WINDIR%\System32\Drivers\etc and put:
tcp 6 TCP
In it and try your code again.
Something else has messed your system up and it is not Perl's fault /J\
|