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

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

Thread Previous | Thread Next
Jesse Luehrs
June 26, 2012 06:42
Re: [perl #113554] my() with empty list causes weird error
Message ID:
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.


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