Conrad.Irwin has asked for the wisdom of the Perl Monks concerning the following question:

I have written a script that uses WWW::Curl::Easy. I wrote it on Cygwin having installed libcurl from source and WWW-Curl from Source. I am now trying to copy this to another Cygwin installation that hasn't got the compilers or make tools - and it is impractical to get them there. Having copied over all of the perl @INC directories, when I create a new WWW::Curl::Easy it gets stuck in an endless loop in AUTOLOAD in Easy.pm. Does anyone know what AUTOLOAD does or how it works - it looks cryptic to me, or why it should be recursive on the one machine but not the other? Is copying modules in this way possible? This is the code for the recursive AUTOLOAD function in WWW/Curl/Easy.pm
sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() # XS function. ( my $constname = $AUTOLOAD ) =~ s/.*:://; return constant( $constname, 0); }

Replies are listed 'Best First'.
Re: Copying Packages without remaking
by ysth (Canon) on Jun 22, 2007 at 00:37 UTC
    When you are building a module, all the files that need to be installed get created under a blib/ directory. So copy all those files onto the second computer into the places they got installed on the first computer.

    AUTOLOAD is a function that is called when some other called function in that package isn't defined. Your AUTOLOAD will recurse if constant() isn't defined, and constant() is presumably provided by the XS portion of the module.

    Note that you'll have to have libcurl installed on the second computer.