sfperl-fixing_the_old_cant_locate_module_problem

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: sfpug@sf.pm.org
From: Joe Brenner <doom@kzsu.stanford.edu>
Subject: [sf-perl] The old INC well
Date: Mon, 04 Feb 2002 20:38:54 -0800

Okay, here's one I'm sure you've all run into before in one
form or another.  You're trying to run some perl code (in
this case, I'm starting up apache, with mod_perl and mason,
but I doubt that matters much), and you get an error
something like

   Can't locate Beatnik/Moloch/lostwatches.al 
   in @INC (@INC contains: /home/luser/perljunk/lib
   /usr/perl/lib/perl-5.63141597/auto/Shineyblack
   /usr/perl/lib/tarian/site_perl .)

But you go and check and lostwatches.al is indeed stuck in 
in your pile of modules, in a location pointed at by @INC. 

Any ideas on possible causes of this kind of trouble?  I've
already triple checked that the two paths match up, which in
my experience has been the most common cause (you know, you
work out the path to where the module is, and add that to
your PERL5LIB, but that can only work if you're doing
something like "use lostwatches", if you're calling it like
"use Beatnik::Moloch::lostwatches" you've got to point at
"Beatnik" a few levels up).

I've also played around with relaxing permissions at all
levels along the path (I made sure user "nobody" had 
at least read access everywhere).

Originally, I had the path going through a few symlinks, but 
I've since tried adding the absolute path at the beginning
of @INC, so that eliminates possible symlink weirdness. 

Paths, permissions, ownership, symlinks... any other
favorite gotchas? 

===

To: sfpug@sf.pm.org
From: Chris Palmer <cecibean@bitstream.net>
Subject: Re: [sf-perl] The old INC well
Date: Mon, 4 Feb 2002 20:59:02 -0800

On Monday, February 4, 2002, at 08:38 , Joe Brenner wrote:

> I've also played around with relaxing permissions at all
> levels along the path (I made sure user "nobody" had
> at least read access everywhere).

Does nobody also have execute permissions on all parent directories? You 
probably already checked that, too.

===

To: sfpug@sf.pm.org
From: Eric Wong <eric@taedium.com>
Subject: Re: [sf-perl] The old INC well
Date: Mon, 4 Feb 2002 23:40:59 -0800

On Mon, Feb 04, 2002 at 08:38:54PM -0800, Joe Brenner wrote:
> 
> Okay, here's one I'm sure you've all run into before in one
> form or another.  You're trying to run some perl code (in
> this case, I'm starting up apache, with mod_perl and mason,
> but I doubt that matters much), and you get an error
> something like
> 
>    Can't locate Beatnik/Moloch/lostwatches.al 
>    in @INC (@INC contains: /home/luser/perljunk/lib
>    /usr/perl/lib/perl-5.63141597/auto/Shineyblack
>    /usr/perl/lib/tarian/site_perl .)
[cut]

I don't know what your exact situation is, so I don't know if this'll
help, but the mod_perl book mentions that mod_perl will restore @INC
to whatever it was at server startup at the end of every request.  I've
never run into a situation where this is a problem ... but there you
go.  The executable directory thing seems more likely.

===

To: sfpug@sf.pm.org
From: jon schatz <jon@divisionbyzero.com>
Subject: Re: [sf-perl] The old INC well
Date: 05 Feb 2002 11:04:42 -0800

On Mon, 2002-02-04 at 20:38, Joe Brenner wrote:
> Okay, here's one I'm sure you've all run into before in one
> form or another. =20

are you using taint checking? -T ignores your $PERL5LIB:

	[jon@devotchka jon]$ echo $PERL5LIB=20
	/home/jon/Foo
	[jon@devotchka jon]$ ls /home/jon/Foo/
	Bar.pm
	[jon@devotchka jon]$ perl -MFoo::Bar -e 'print "fnord\n"'
	fnord
	[jon@devotchka jon]$ perl -T -MFoo::Bar -e 'print "fnord\n"'
	Can't locate Foo/Bar.pm in @INC (@INC contains:
	/usr/local/lib/perl5/5.00503/i686-linux 	/usr/local/lib/perl5/5.00503
	/usr/local/lib/perl5/site_perl/5.005/i686-linux
	/usr/local/lib/perl5/site_perl/5.005).
	BEGIN failed--compilation aborted.

i got around this at a former employer by hacking the perl source before
compilation.=20

-jon

===

To: sfpug@sf.pm.org
From: jon schatz <jon@divisionbyzero.com>
Subject: Re: [sf-perl] The old INC well
Date: 05 Feb 2002 11:13:25 -0800

On Tue, 2002-02-05 at 11:04, jon schatz wrote:
> i got around this at a former employer by hacking the perl source before
> compilation.=20

i meant to say, "I got around this by hacking the perl C source before
compiling perl." sorry.

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu