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
Father Chrysostomos
January 28, 2014 04:02
Re: [perl #121077] [PATCH] Optimise 'my $x; my $y' into 'my ($x, $y)'
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About