[pgh-pm] use of require and full paths
Daniel J. Wright
Dan at DWright.Org
Tue Jul 6 17:28:41 CDT 2004
I don't think it has changed. I don't think that ever should have worked.
The only way that should work is if "/" is in @INC.
Your options are:
1. put "/" in @INC
2. change SITE_CONFIG_FILE to just be 'RT_SiteConfig.pm'
3. change your "require" command to a "do" command.
I'm running RT 3.0.7, and I can't find the SITE_CONFIG_FILE variable in
the source code anywhere. It must be something new.
Regards,
-Dan
> 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
>
> _______________________________________________
> pgh-pm mailing list
> pgh-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/pgh-pm
>
More information about the pgh-pm
mailing list