develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #9336] Changing a for array dumps core

From:
Steve Peters via RT
Date:
July 13, 2005 07:43
Subject:
[perl #9336] Changing a for array dumps core
Message ID:
rt-3.0.11-9336-117192.4.46200151891659@perl.org
> [RT_System - Tue May 14 00:25:37 2002]:
> 
> ton@infonet-europe.net wrote:
> > Ok, i know the docs say not to do things like this, but it still 
> > shouldn't dump core:
> > perl -wle '$#F-- for@F=1..5'
> 
> You play too much golf, don't you.
> 
> This bug is confirmed with bleadperl.
> Strangely, moving the assignment out of the for() statement :
>      $ bleadperl -e '@x=1..5; $#x-- for @x'
> doesn't dump core.
> 
> 

This coredump seems to have been resolved sometime prior to Perl 5.8.7.

> perl -wle '$#F-- for@F=1..5'
Use of freed value in iteration at -e line 1.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About