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

Re: defined(@arr), defined (%hash)

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
November 21, 2011 15:14
Subject:
Re: defined(@arr), defined (%hash)
Message ID:
20111121231429.GX6369@tozt.net
On Mon, Nov 21, 2011 at 06:09:48PM -0500, Ricardo Signes wrote:
> 
> Is there any defense for these constructions?
> 
> Why shouldn't:
> 
>   1. defined(@arr) and defined(%hash) warn

$ perl -E'use warnings; say defined(my @a)'
defined(@array) is deprecated at -e line 1.
        (Maybe you should just omit the defined()?)

>   2. (@arr // $x) and (%hash // $x) warn

I agree that this should warn - this topic came up in the earlier thread
about what // really means (and how it is different from defined() in
certain ways), but I don't know if it ever reached a consensus.

-doy

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