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

Hello,

I had a script that uses Image::ThousandWords module, which has Image::Thumbnail as its prerequisite. However, when I ran my script, I got this error:

Can't locate Image/Thumbnail.pm in @INC (@INC contains: /usr/lib/perl5 +/5.8.1/i686-linux /usr/lib/perl5/5.8.1 /usr/lib/perl5/site_perl/5.8.1 +/i686-linux /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5 +.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at /u +sr/lib/perl5/site_perl/5.8.1/Image/ThousandWords.pm line 77. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.1/Im +age/ThousandWords.pm line 77. Compilation failed in require at temp3.cgi line 9. BEGIN failed--compilation aborted at temp3.cgi line 9.
My provider replied:

It was installed at: CPAN.pm: Going to build /LG/LGODDARD/Image-Thumbnail-0.42.tar.gz

Looking for Image::Magick ... ok Checking if your kit is complete... Looks good Writing Makefile for Image::Thumbnail /usr/bin/make -- OK Running make install Writing /usr/lib/perl5/site_perl/5.8.1/i686-linux/auto/Image/Thumbnail +/.packlist Appending installation info to /usr/lib/perl5/5.8.1/i686-linux/perlloc +al.pod /usr/bin/make install UNINST=1 -- OK perlmod--Install done
What could be the problem? What solution should I take?

Thanks, Jay Soon

Edit by tye, add CODE tags to wrap long tokens

Replies are listed 'Best First'.
Re: Problem with Image::Thumbnail and Image::ThousandWords
by saintmike (Vicar) on Mar 19, 2004 at 05:39 UTC
    If your provider can't fix it (they should be able to, but sometimes providers are incompetent), and if you have shell access to your account (no need for root access), you can install the module yourself:

    Assuming your home directory is /home/jaysoon, create a directory like /home/jaysoon/perl-modules, and invoke the CPAN shell like this from the command line:

    perl -e'use lib "/home/jaysoon/perl-modules"; use CPAN; shell'
    Then, answer a couple of questions and at the prompt, say

    cpan> install Image::Thumbnail
    Once the module has been installed, quit the shell and use

    use lib '/home/jaysoon/perl-modules'; use Image::Thumbnail;
    in your Perl scripts to pull it in. This way, you can manage your modules without dealing with the provider every time.
      I finally confirmed that Thumbnail.pm was not installed in a directory covered by the above PATH's I mentioned.

      From saintmike's suggestion, I tried to manually copy /Image/Thumbnail.pm and placed it in a certain directory. From my script, I added "use lib 'DIRECTORY_I_COPIED_THEM'" and the whole thing worked.

      THANKS!!!!
Re: Problem with Image::Thumbnail and Image::ThousandWords
by coec (Chaplain) on Mar 19, 2004 at 05:11 UTC
    What version of Perl is your provider using; 5.6.0, 5.6.1 or 5.8.1? It seems your search path spans these three versions.

    CC