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

Hello Monks,

I have been on quest to understand how to make thumbnails through a CGI. To make a long story short I need to use GD.pm 1.6.2 or later(with JPEG support).

I have had a misserable time fiquring out why this simple script would not work.

Well finally I understand that my web host is still using (GD.pm 1.1.8)

Any way my little script has use GD.pm; but I need to use a newer module in my cgi-local directory. I am not sure how to make certain that my little script does not access the old version and as important make sure it uses the new version in the script.

What is the best way to do this?

Thanks

Cal

Replies are listed 'Best First'.
Re: using another module
by artist (Parson) on Oct 31, 2002 at 22:42 UTC
    Hi Cal
    One way is to
    unshift @INC, '/path/to/cgi-local';
    OR
    use lib '/path/to/cgi-local'

    Practicing the nearby art.
    Artist

      Thanks , How can I be sure that it is the right module. Cal
Re: using another module
by robartes (Priest) on Oct 31, 2002 at 22:54 UTC
    artist's answer is correct. To expand upon it, if you want to do this in a portable fashion, or the directory with your script and GD.pm might change, use the standard FindBin module:
    use FindBin; use lib $FindBin::Bin;
    The above code will add the directory where your script resides (well, technically the current working directory of your script when FindBin was used) to the library searchpath.

    CU
    Robartes-

      Thanks, Does this only work if the CGI directory is named cgi-bin or could it be cge-whatever?
        It works wherever the script is located. Could even be in a directory named there_be_no_modules_here_so_go_away :).

        CU
        Robartes-