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

Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
January 28, 2014 04:02
Subject:
Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'
Message ID:
20140128040250.4124.qmail@lists-nntp.develooper.com
Dave Mitchell wrote:
> In that case, the only thing your change would affect is that any warnings
> that were generated post your change that affected the first 'my' would appear
> to come from the later 'my'; e.g.
> 
>     my $x;  # a warning here appears to come from line 2 rather than line 1
>     my $y;
> 
> but I doubt there are any such warnings.

$ perl -we 'my $x; my $x; my $y'
"my" variable $x masks earlier declaration in same scope at -e line 1.


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