[pgh-pm] use of require and full paths

James O'Kane jo2y at midnightlinux.com
Tue Jul 6 15:51:31 CDT 2004


Has the semantics of 'require' changed in recent versions of perl?

I have someone else's code, (RT3.0.11 specifically), that does this:

$SITE_CONFIG_FILE = "/home/rt/rt3/etc/RT_SiteConfig.pm";
[...]
require $SITE_CONFIG_FILE;

This results in:

Can't locate /home/rt/rt3/etc/RT_SiteConfig.pm in @INC (@INC contains:
/home/rt/rt3/local/lib
/home/rt/rt3/lib
/home/rt/rt3/etc/
/home/rt/perl/lib/
/usr/lib/perl5/5.8.4/i686-linux
/usr/lib/perl5/5.8.4
/usr/lib/perl5/site_perl/5.8.4/i686-linux
/usr/lib/perl5/site_perl/5.8.4
.
) at /home/rt/rt3/lib/RT.pm line 105.

===========

I've seen the same use in some inherited code from the 5.00x era.
I think I understand what is happening, what I don't understand is why and
what changed? Did I accidentally turn on some setting that makes require
only append its arguements to things in @INC?

thanks

-james




More information about the pgh-pm mailing list