$ perl -we'@foo = 1..10; for (@foo) { delete $foo[10-$_] } print scala +r @foo' 5 $ perl -we'@foo = 1..10; for (my @bar=@foo) { delete $foo[10-$_] } pri +nt scalar @foo' 0 $ perl -we'@foo = 1..10; for (@foo,()) { delete $foo[10-$_] } print sc +alar @foo' Use of freed value in iteration at -e line 1.
In reply to Re^3: reuse of split variable?
by ysth
in thread reuse of split variable?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |