[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Dec 2002 ]

Re: [edlug] Help with Perl @INC path



On Mon, 16 Dec 2002, Peter wrote:

> Date: Mon, 16 Dec 2002 10:48:16 +0000
> From: Peter <junk@xxx.xxx.xxx>
> To: edlug@xxx.xxx.xxx
> Subject: [edlug] Help with Perl @INC path
>
>
>
> Hi
> I'm running Mandrake 8.2 and recently it's lost the list of sources for software updates
> After a bit of digging around, I found out about urpmi, so I tried
> [root@krabi sbin]# urpmi.addmedia updates
> ftp://mirrors.secsup.org/pub/linux/mandrake/Mandrake/updates/8.2/RPMS
> with ../base/hdlist.cz
>
> and got:
> Can't locate urpm.pm in @INC (@INC contains:
> /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
> /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
> /usr/lib/perl5/site_perl .) at /usr/sbin/urpmi.addmedia line 22.
>
> [root@krabi sbin]# locate urpm.pm
> /usr/lib/perl5/vendor_perl/5.8.0/urpm.pm
>
> So it seems that I must have updated Perl from 5.6.1 to 5.8.0, and that
> the update forgot to change the include path.
>
> Can someone tell me how to correct the Perl include path used in @INC? I
> know nothing to very little about Perl (ie not enough to be able to find
> the answer at perldoc.com, though I did try), so be kind!

The list of paths that perl searches is compiled into the perl executable,
but it can be extended with the PERL5LIB environment variable setting,
and can also be overriden completely within a script through the @INC
global.

You can just set and export PERL5LIB=/usr/lib/perl5/vendor_perl/5.8.0 in
your shell before running urpmi.addmedia.  This will solve your immediate
problem but you're likely to find that similar issues crop up elsewhere
with other things that expect to find the vendor_perl/5.8.0 directory.
It's probably worth recompiling perl at some stage to fix this.  It's a
little bit time consuming but not all that hard.  You should be able to
just accept defaults for all the questions except the ones you know you
want to change - ie the library search paths.  If you run 'perl -V'
beforehand you can get complete information on the compilation options
used in the currently installed perl, which is probably a good thing to
have on hand in case you run into problems.

Andrew

------------------------------------------------------------------
Andrew McNaughton                   In Sydney and looking for work
andrew@xxx.xxx.xxx          http://staff.scoop.co.nz/andrew/cv.doc
Mobile: +61 422 753 792



-----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble@morpheux.org.DONTSPAMME
homepage