in reply to Re: RFC - FAQ for Modification of a read-only value attempted
in thread RFC - FAQ for Modification of a read-only value attempted
Output:my @array= (1,2,3,4); for my $item (@array) { pop @array; printf "Item: %s Array: %s\n",$item,join(', ', @array); }
If for was iterating over a list that would imply that it wa s divorced from the @array object, and that modifying the @array object would not affect the loop - no?Item: 1 Array: 1, 2, 3 Item: 2 Array: 1, 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC - FAQ for Modification of a read-only value attempted
by Leviathan (Scribe) on Aug 29, 2006 at 13:52 UTC | |
|
Re^3: RFC - FAQ for Modification of a read-only value attempted
by Anonymous Monk on Aug 29, 2006 at 13:46 UTC | |
by imp (Priest) on Aug 29, 2006 at 14:16 UTC |