in reply to Re: Getting IPv6 with the Cookbook
in thread Getting IPv6 with the Cookbook

Ok, that library was new to me, I had done some searching and all I found was Socket6. Didn't think about INET6 on that one, my bad.

Now this gets a little off topic, but in the setup I have we have a small Perl distro with the specific libraries we are using, mostly homemade modules and such, plus libraries like INET and INET6. I added this one as usual, and it needed Socket6, which I did have but was not using. Though when I try and run my program I get:
Can't locate object method "bootstrap" via package "Socket6" (perhaps you forgot to load "Socket6"?) at C:/work/emx-qa/M OTH/newdummy/../Perl/IO/Socket/Socket6.pm line 289.
Compilation failed in require at C:/work/emx-qa/MOTH/newdummy/../Perl/IO/Socket/INET6.pm line 18.
BEGIN failed--compilation aborted at C:/work/emx-qa/MOTH/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.

I haven't hit AutoLoader stuff much in the past, and basically I have always been able to just add pm files to the right locations in our distro and have no issues. But this one seems off, and I can't seem to find more about it. Do I need to add a bootstrap function to the library file? I noticed another library file had it there, but this one does not, I just grabbed Socket6 and the others from CPAN and put them in the right locations.

Going to keep looking, but anything else is appreciated. Really glad for the help here, and once I get this running I'll put up the working code.

Ciao

Replies are listed 'Best First'.
Re^3: Getting IPv6 with the Cookbook
by gokuraku (Monk) on Dec 20, 2007 at 14:43 UTC

    One bad thing I did was comment out the bootstrap line in the Socket6.pm file (bootstrap Socket6 $VERSION;), that tends to cause the following loop to occur when trying to create the server.

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

    Which is the beginning of the AutoLoad function in Socket6.pm

    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; }

    This also has the effect of taking memory away from the machine until it runs out, a good way to starve the machine if you need to do that I suppose. But definitely not what I would like to have happen.