this makes a copy of the elements of @arr to loop over, without using a (named) variable.for my $x (@{[]} = @arr) { ... }
In reply to Re: Why does a full iteration over array & shift is not emptying the array
by JavaFan
in thread Why does a full iteration over array & shift is not emptying the array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |