develooper Front page | perl.perl5.porters | Postings from April 2000

Re: IO::Socket returns "Unknown error" (APR#257)

Thread Next
Gurusamy Sarathy
April 9, 2000 08:43
Re: IO::Socket returns "Unknown error" (APR#257)
Message ID:
On Sat, 08 Apr 2000 18:32:03 PDT, wrote:
>Full_Name: Dave Edis
>Version: ActivePerl 613
>OS: Windows NT 4.0 SP 6
>Submission from: (NULL) (
>Perl 5.6 seems to "break" all our sockets code.  Attached is
>a sample script that works great in 5.005 but returns
>"Unknown Error" in 5.6.  
>We've duplicated it on NT 4.0 SP6 and Win98 with both a upgrade
>and a clean install of ActivePerl.
>  use IO::Socket;
>  $remote = IO::Socket::INET->new(
>				Proto => "tcp",
>				PeerAddr => "",
>				PeerPort => "http(80)"
>				);
>  if (!$remote) { print $!; exit; }
>I think this may be related to bug report #64.
>Any insights would be greatly appreciated.  Thanks guys!

This happens because Windows is missing an entry for "http" in the
winnt/system32/drivers/etc/services database.  It works if you
add a line like the following in that file:

    www       80/tcp      http

It apparently worked in previous versions because IO::Socket used
to ignore failures in looking up the service name when the port was
also specified, but doesn't anymore.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About