Only if you've been forced to only use one type of loop the rest of your life (borrowing a concept from a recent poll). Your solution works by making a duplicate copy of the array. It results in the original array not being modified, so if the intent is to one by one remove all elements of @a, the intent will never be satisfied. Instead, one by one, all elements of a copy of @a will be removed, and @a remains unchanged.
Fortunately we live in a world with alternatives to foreach ;)
Dave
In reply to Re^2: Array Processing
by davido
in thread Array Processing
by Rajeshk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |