develooper Front page | perl.perl5.porters | Postings from November 2003

Re: bug or a feature?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 8, 2003 06:45
Subject:
Re: bug or a feature?
Message ID:
20031108144433.GD6287@plum.flirble.org
On Fri, Nov 07, 2003 at 08:32:49PM +0100, Torsten Foertsch wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Is it a bug or a feature?
> 
> # perl -e 'open F, "/" and defined(scalar <F>) and print "ok\n"; print "$!\n"'
> Is a directory
> 
> but
> 
> # perl -e 'undef $/;open F, "/" and defined(scalar <F>) and print "ok\n";
> print "$!\n"'
> ok
> Is a directory
> 
> 
> verified with 5.8.0 and 5.8.2 on Linux.

$ perl5.00503 -we 'undef $/;open F, "/" and defined(scalar <F>) and print "ok\n"; print "$!\n"' /
ok
Is a directory

$ perl5.00405 -we 'undef $/;open F, "/" and defined(scalar <F>) and print "ok\n"; print "$!\n"' /
Is a directory

[also on Linux]

So something changed as far back as 5.005

> I think C<< scalar <F> >> should return C<undef> even if not defined $/,
> shouldn't it?

I also think that both should be undef.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About