develooper Front page | perl.perl5.porters | Postings from October 2011

Re: [perl #102464] is warning valid?

Thread Previous | Thread Next
From:
Eric Brine
Date:
October 29, 2011 14:53
Subject:
Re: [perl #102464] is warning valid?
Message ID:
CALJW-qEOoZYjtMgoYL=Uy_JnuYbKavUZDHH1etyiBH_yDSirPw@mail.gmail.com
On Sat, Oct 29, 2011 at 4:16 PM, Linda Walsh <perl-diddler@tlinx.org> wrote:

> languages (macro,shell), where testing if something exists doesn't normally
> throw an error no matter if 'lint' is or or similar....
>

Again, defined doesn't check existence. If it did, it would always return
true for defined($foo)

>perl -E"say exists $::{foo} ?1:0;"
0

>perl -E"say exists $::{foo} ?1:0;  defined($foo)"
1

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