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

G'day monks.
I've had a CGI program running on a server that has Digest::MD5 installed, and I made extensive use of it. I've just started using a new server and they don't have it, and WILL NOT install it for me. How you can be without such a module is beyond me - guess I should have checked before changing. Anyway........
My question: Is it possible to tweak the module so that it will work from the cgi-bin folder (included of course in the @INC list)?
Many thanks,
traxlog

Replies are listed 'Best First'.
Re: taking Digest::MD5 with you
by inman (Curate) on Oct 20, 2003 at 13:26 UTC
    Consider using Digest::MD5::Perl. As a perl implementation, it should be easier to just copy the module to your new host.

    Your @INC should include the current directory. Locate your modules in a directory relative to this.
    e.g. cgi-bin/Digest/MD5/Perl.pm

    Inman

Re: taking Digest::MD5 with you
by edan (Curate) on Oct 20, 2003 at 13:23 UTC
Re: taking Digest::MD5 with you
by ptkdb (Monk) on Oct 20, 2003 at 13:29 UTC
    If it's essential to the operation of your web site, try harder to convince them. Having a fully configured perl installation is far better than the hack I'm about recommend. Failing that...

    You can 'tweek' the Makefile.PL at the command line level to install the module into a custom directory, if you have access to one.

    perl Makefile.PL PREFIX=<mydir> make && make install
    Then you set the PERL5LIB environmental variable to point to this directory:

    export PERL5LIB=$PERL5LIB:<mydir>/lib:<mydir>/lib/site_perl OR setenv PERL5LIB $PERL5LIB:<mydir>/lib:<mydir>/lib/site_perl
    I'm not sure, but this might work, in your script you can tweek the env PERL5LIB variable BEFORE the first 'use' statement

    $ENV{PERL5LIB}=$ENV{PERL5LIB}::<mydir>/lib:<mydir>/lib/site_perl use Digest::MD5 ;