in reply to Re (tilly) 4: How do I remove an element from any array while iterating over it in a loop?
in thread How do I remove an element from any array while iterating over it in a loop?
Here's the summary:
where grep_proc returns true (keep) or false (discard); and map_proc returns the original element to keep, or an empty list to discard.@array= map { map_proc } @array; @array= grep { map_proc } @array;
I agree that grep gives the idea of filtering. But he's not just filtering; he's altering. Altering where "delete" is one possibility.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 6: How do I remove an element from any array while iterating over it in a loop?
by tilly (Archbishop) on Aug 31, 2001 at 07:42 UTC | |
by John M. Dlugosz (Monsignor) on Aug 31, 2001 at 08:06 UTC |