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

Re: [perl #113554] my() with empty list causes weird error

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
June 26, 2012 06:42
Subject:
Re: [perl #113554] my() with empty list causes weird error
Message ID:
20120626134210.GM30375@tozt.net
On Tue, Jun 26, 2012 at 01:44:17PM +0200, demerphq wrote:
> And thats a good example, yes perl allows you to write
> 
> printf "%d", my $x=10;
> 
> but should it really allow:
> 
> printf "%d", my(), my(), my(), my(),my $x=10,my();

Are you also proposing to disallow '() = (1, 2, 3)'? Or
'($foo, (), $bar) = (1, 2)'? If not, why not? Both of those are
currently valid, and I can't really see any reason why putting a 'my' in
front of them makes them any more or less nonsensical. I just want
something that is consistent.

-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