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

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

Thread Previous | Thread Next
Jesse Luehrs
November 21, 2011 15:14
Re: defined(@arr), defined (%hash)
Message ID:
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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About