On Fri, Oct 31, 2003 at 02:46:48PM -0800, Stas Bekman wrote:
> In other words, it's because $foo is not a bareword in this case.
> 
> But I did see many occurences of code where the module is hardcoded and is 
> a bareword:
> 
>   eval "require CGI";
> 
> when I was proposing to use the block, I'd always get the answer that it 
> won't work with older perls.

Oh, I think its just because in that case the string vs block versions
do the same thing and people get sloppy.  I've done it.

Anyhow, until someone shows me that it breaks on 5.005_03 and up I'm using
a block.


> Funny that while doing a sanity check I did:
> 
> % perl-5.8.2 -le 'my $mod = "threads"; require $mod'
> threads did not return a true value at -e line 1.
> 
> it actually read the directory 'threads' as a file. What would happen if 
> the directory's contents happened to have a true value at the end? will 
> require be sucessful? Shouldn't it test that the file it's going to read is 
> actually a file?

There was just a big umm, thread on this earlier, but I don't think it
was noticed that require() effected.  Yeah, it probably should check that
its a file.


-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Do not try comedy at home!  Milk & Cheese are advanced experts!  Attempts at
comedy can be dangerously unfunny!

Reply via email to