The error originates from UNIVERSAL::VERSION, which is called as Socket->VERSION(1.3); by use Socket 1.3;

The error can be recreated by executing that line without first loading the module.

$ perl -e'Socket->VERSION(1.3)' Socket defines neither package nor VERSION--version check failed at -e + line 1.

The only explanation I can fathom (other than a bug) is that Perl thinks the module has been loaded when it hasn't.

$ perl -e'BEGIN { $INC{"Socket.pm"}=1; } use Socket 1.3' Socket defines neither package nor VERSION--version check failed at -e + line 1. BEGIN failed--compilation aborted at -e line 1.

Are you playing with %INC or using some kind of packager?

Even looking at it can vivify it in some circumstances.

$ perl -e'BEGIN { 1 for $INC{"Socket.pm"}; } use Socket 1.3' Socket defines neither package nor VERSION--version check failed at -e + line 1. BEGIN failed--compilation aborted at -e line 1.

What do you get if you place the following before use IO::Socket;

BEGIN { if (exists($INC{"Socket.pm"}) { if (defined($INC{"Socket.pm"}) { warn(">>> \"$INC{"Socket.pm"}\"\n"); } else { warn(">>> undef\n"); } } else { warn(">>> absent\n"); } }

In reply to Re: IO::Socket fails!! by ikegami
in thread IO::Socket fails!! by MarkovChain

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.