develooper Front page | perl.perl5.porters | Postings from December 2011

[perl #7411] local($#array) is not local :(

Thread Previous | Thread Next
From:
Leon Timmermans via RT
Date:
December 11, 2011 11:41
Subject:
[perl #7411] local($#array) is not local :(
Message ID:
rt-3.6.HEAD-5084-1323632491-1159.7411-15-0@perl.org
On Tue Jul 31 05:05:12 2001, jefpin@towers.crusoe.net wrote:
> [Please enter your report here]
> 
>   @a = (1..5);
>   {
>     local $#a = 2;
>     print "@a\n";
>   }
>   print "@a\n";
> 
>   __END__
>   1 2 3
>   1 2 3
> 
> That's a bit discouraging.

I'm not sure there's a sane way to support this. At the very least we
could this warn. It's really easy to do at runtime and shouldn't be too
hard at compile-time either, I think.

Leon

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