develooper Front page | perl.perl5.porters | Postings from January 2012

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

Thread Previous | Thread Next
From:
demerphq
Date:
January 3, 2012 05:25
Subject:
Re: defined(@arr), defined (%hash)
Message ID:
CANgJU+WTQp4AA=0iKt4RK6NcM-02d4tZ7oywE+UvFH5O+B8r7g@mail.gmail.com
On 22 November 2011 00:09, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
>
> Is there any defense for these constructions?
>
> Why shouldn't:
>
>  1. defined(@arr) and defined(%hash) warn

Fair enough.

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

Personally i expect this to be parsed as

((scalar(@arr) // $x)
((scalar(%hash) // $x)

in which case IMO it should NOT warn.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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