in reply to Deleting elements from array questions
If you want to remove the elements from the array entirely, grep is the way:
That eliminates fencepost errors and leaves no empty slots in the array. Your code should work, but it does not remove the array slot.@array = grep { $_ ne $item } @array;
Updade: Corrected pasteo.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Deleting elements from array questions
by sauoq (Abbot) on Aug 08, 2002 at 18:25 UTC |