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

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

Thread Next
From:
Gurusamy Sarathy
Date:
April 9, 2000 08:43
Subject:
Re: IO::Socket returns "Unknown error" (APR#257)
Message ID:
200004091543.IAA23714@maul.ActiveState.com
On Sat, 08 Apr 2000 18:32:03 PDT, dave@interactivetools.com wrote:
>Full_Name: Dave Edis
>Version: ActivePerl 613
>OS: Windows NT 4.0 SP 6
>Submission from: (NULL) (24.113.48.112)
>
>
>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 => "www.yahoo.com",
>				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.


Sarathy
gsar@ActiveState.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About