You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2000/07/30 03:46:56 UTC

require bug?

I noticed that the following bit of code does not work properly:

require 'test.pl';
chdir '..';
require 'test.pl';

Even though the second require is trying to load a different file, perl
thinks that it is the same file and therefore doesn't require it again (I
had to use the 'do' command instead).

Is this a bug, or is it supposed to work like that?

-Philip Mak (pmak@aaanime.net)


Re: require bug?

Posted by Stas Bekman <st...@stason.org>.
Philip Mak wrote:
> 
> I noticed that the following bit of code does not work properly:
> 
> require 'test.pl';
> chdir '..';
> require 'test.pl';
> 
> Even though the second require is trying to load a different file, perl
> thinks that it is the same file and therefore doesn't require it again (I
> had to use the 'do' command instead).
> 
> Is this a bug, or is it supposed to work like that?

It's not a bug. See
http://perl.apache.org/guide/porting.html#Name_collisions_with_Modules_and
for more info

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:stas@stason.org   http://perl.org     http://stason.org/TULARC
http://singlesheaven.com http://perlmonth.com http://sourcegarden.org