In the setup I have there is a small Perl distro with the specific libraries needed, mostly homemade modules and such, plus libraries like INET and INET6. This is to allow the code to run with default installs of Perl, and pull additional libraries as needed from the distro, this has worked fine in the past. I added Socket6.pm to the distro to support the INET6.pm which I needed to get my server script to make an IPv6 server, when I a perl -c on the program I get:

Can't locate object method "bootstrap" via package "Socket6" (perhaps you forgot to load "Socket6"?) at C:/work/newdummy/../Perl/IO/Socket/Socket6.pm line 289. Compilation failed in require at C:/work/newdummy/../Perl/IO/Socket/INET6.pm line 18. BEGIN failed--compilation aborted at C:/work/newdummy/../Perl/IO/Socket/INET6.pm line 18. Compilation failed in require at dummyserver.pl line 22. BEGIN failed--compilation aborted at dummyserver.pl line 22.

The Paths in this are correct, I haven't hit AutoLoader stuff much in the past, and I have always been able to add pm files to the right locations in our distro and have no issues. This one is weird, and like others in the past I copied the source from CPAN and placed it in the package location in IO/Socket, I can't seem to find more about the error though. I've converted the paths in the modules without success, considered maybe the paths needed to be all the same but only the package IO::Socket::Socket6 path was required, the rest of the module refers only to use Socket6 and the bootstrap Socket6 $VERSION line. The only way I have been able to get past this was to remove the line:

bootstrap Socket6 $VERSION;

from the Socket6.pm file, but doing that generates a loop in:

sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { if ($! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } else { my ($pack,$file,$line) = caller; croak "Your vendor has not defined Socket macro $constname, us +ed"; } } eval "sub $AUTOLOAD { $val }"; goto &$AUTOLOAD; }

on the lines:

my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0);

which infinitely loops until it takes all the free memory on the machine.

I can't find anything that's really helpful with this, or why I am getting the error only for this library. Been looking into AutoLoader and from what I can tell everything seems to be correct.

Has anyone hit this and gotten past the error at all?

Thanks


In reply to can't locate object method bootstrap by gokuraku

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.