spurperl has asked for the wisdom of the Perl Monks concerning the following question:

There are tons of useful modules at CPAN, and at times I install some to help my scripts. The installation is local to some machine...

Problems arise if people want to run this script on another machine, it looks for the modules and doesn't run.

Is there any way to overcome this ? I mean, not having to install all the modules on all machines (what about customer sites ?).

More specifically, is it possible to create a package of the script + all (non standard) modules it needs, and put it on various machines, so it will work everywhere ?

TIA

Replies are listed 'Best First'.
Re: A problem with modules installation
by chromatic (Archbishop) on Dec 02, 2002 at 06:55 UTC

    PAR looks like a good solution. It won't work "everywhere" though, as modules with XS bits aren't usually binary portable. CPAN::Bundle is another idea.

Re: A problem with modules installation
by rinceWind (Monsignor) on Dec 02, 2002 at 15:25 UTC
    There are several ways to overcome this, depending on the platform, and whether perl is already installed on the target system.

    For Windows environments, take a look at perl2exe from http://indigostar.com. It's not free, but there ain't no such thing as a free lunch.

    If perl is already installed on the system, and there are no XS extensions in the modules that you are using, you can probably get away with including the modules in the archive kit, using paths relative to '.' You might want to make sure that '.' is included in the @LIB path (beware, security risk!)

    If there are modules with extensions, you will need to make sure that binaries are available for all platforms of the target machine that you require. Then consider building kits for ActiveState PPM or RPM.

    Hope this helps,

    --rW