I upgraded my linux box from RH7 to RH8 and that upgraded PERL from 5.6 to 5.8. Now, Perl gives the following error when my script tries to run some Perl Magick stuff:
Can't locate Image/Magick.pm in @INC (@INC contains: [...]
Can someone familiar with the PERL INC array, Image Magick and Linux please explain how I can either point PERL in the right direction, move the scripts to a visible path, or upgrade Image Magick. I just need the darn thing to work again.
The @INC array contains the paths where perl looks for modules. When you write:
use The::Module::Name;
in your program, perl looks for The/Module/Name.pm file under one of those directories found in @INC. If it can't find a module there, it usually means it is just not installed (or like in this case it is installed somewhere else for a different version of Perl). Run this command as root:
cpan Image::Magick
if you have cpan script installed, or this:
perl -MCPAN -e 'install "Image::Magick"'
to install the Image::Magick module. To run the interactive CPAN shell, run:
cpan
with no arguments, or:
perl -MCPAN -e shell
and type:
install Image::Magick
You should install every module that way. Of course it's possible to download and install modules manually (see perldoc perlmodinstall), but with CPAN shell it's much easier and you don't have to worry about prerequisites.
If you have your module installed in some nonstandard place and you want to add that directory to @INC, use this:
use lib '/your/new/path';
in your program, before you
use Your::Module;
Next time before you upgrade your perl, you might take a look at the autobundle command in CPAN shell (or "cpan -a" from command line). It makes a snapshot of all your installed CPAN modules which you can then install all at once later after you upgrade perl on your system or anywhere else.
See: perldoc CPAN
http://search.cpan.org/search?module=CPAN
-- ZSDC Perl and Systems Security Consulting
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>