in reply to can't locate object method bootstrap

... at C:/work/newdummy/../Perl/IO/Socket/Socket6.pm

What seems strange is that you have Socket6.pm in the directory .../IO/Socket/. And what's even stranger is that something is in fact pulling it in from there...

The only circumstance under which I can reproduce your problem can't locate object method "bootstrap" via package "Socket6" is by putting Socket6.pm where you have it, plus adjusting the namespace from package Socket6; to package IO::Socket::Socket6;, and then modifying the use statement use Socket6; in IO::Socket::INET6 to read use IO::Socket::Socket6;. In this case I also do get

Can't locate object method "bootstrap" via package "Socket6" (perhaps +you forgot to load "Socket6"?) at IO/Socket/Socket6.pm line 279.

(which is not too surprising, as the package is now "IO::Socket::Socket6"...)

So... did you do anything like this??

Normally, the directory layout should be:

.../Perl/Socket6.pm .../Perl/auto/Socket6/Socket6.so # the XS component of Socket6 (.d +ll on Windows) .../Perl/IO/Socket/INET6.pm

(where .../Perl is a directory that's in @INC)

Replies are listed 'Best First'.
Re^2: can't locate object method bootstrap
by gokuraku (Monk) on Dec 21, 2007 at 16:14 UTC

    Well I tried to put the Socket6.pm in the same location as INET6.pm, which I added in a similar manner as Socket6.pm, and its having no problems being found. It's the call to Socket6.pm from INET6.pm that is generating the issue.

    Tried your paths and it didn't work, but I don't have the auto directory and the SO file since this is a distro that gets moved around, its not a Perl install on the machine. I actually added this into my own ../Perl/Lib directory with the same package info as my own modules that are found without issue, and it generates the "can't load loadable object for module..." error.

    Not even sure where I can go with this unless I try and install the module locally then move the files to my own distro and see if that works.

      ... but I don't have the auto directory and the SO file

      Ah, I'm beginning to see what the problem is.  Thing is, you do need this shared object file, because Socket6 is an architecture-specific Perl module. And if you need to install it on 30+ machines of varying architectures, you're going to need a separate .so file (or .sl or .dll for that matter) for every different architecture (and Perl version). There's no way around it, however unfortunate that may be.

      There are essentially two types of modules: architecture-independent pure Perl modules, and architecture-dependent ones (often called XS modules, because that's the default method to write Perl extensions (Perl-C bindings)). Only the former ones are portable across architectures. The latter ones comprise a shared object file (compiled machine code) in addition to the regular .pm file (and the shared object may itself depend on other shared objects, depending on what it was linked against). It's DynaLoader's bootstrap method that's pulling the .so file in. If it can't find it, you'll get

      can't load loadable object for module...

      The fact that you did not get this message with your other directory setup, but rather the message can't locate object method "bootstrap"... doesn't mean that you've somehow magically gotten past this problem... Quite the contrary, you're not even as far as that. Once the bootstrap method is found, it will complain about the missing .so file.

        Ok, that makes a lot more sense now. I'll have to make some changes in how we do things then, but if this is how the modules are done. So be it. Thanks very much for clearing it all up!