Literally all of a sudden LWP has stopped working on my Win32 box. Everything networky except Perl is *still working* so I can browse, email, telnet, ssh etc. The error is:

500 Can't connect to api.google.com:80 (Bad protocol 'tcp') at google +line 5

There was a node Problem using Perl to access a webpage with the same error but there are no really useful answers (iburrel is the only one who almost fingers the problem). Why? If you read the IO::Socket::INET source you will see that this error actually means that the getprotobyname('tcp') call fails. You can test it directly like this:

# Linux $ perl -le '$,=" "; print getprotobyname("tcp")' tcp TCP 6 # Working Win32 system C:\>perl -le "$,=' '; print getprotobyname('tcp')" tcp TCP 6 C:\> # Broken Win32 system C:\>perl -le "$,=' '; print getprotobyname('tcp')" C:\> # Broken Win32 system Cygwin Administrator@JAMES ~ $ perl -le '$,=" "; print getprotobyname("tcp")' Administrator@JAMES ~ $

Now on Unix systems getprotobyname() is normally a lookup in the file /etc/protocols, where you find a entry for 'tcp'. I have no idea how this database is mantained under NT but mine has become corrupt.

Does anyone know where this info is maintined in Win32? As you can see it is related to the OS rather than Perl as even Cygwin is trying to get its data from here (and failing).

And no reinstalling Perl and Re-service packing the machine did not fix the issue. What changed between working and not working? Dunno - not much in the way of software that I can recall (a few hotfixes for last years bugs of course). Adaware is one new widget that does delete from the registry. It is a W2K box so there is no rollback. I will reinstall the OS if it comes to that but would prefer not to. I have googled and Super Searched, scanned the registry to no avail. Anyone got the juice on this?

cheers

tachyon


In reply to bad protocol 'tcp' win32 error because getprotobyname is failing by tachyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.