in reply to Splice not working or is it me?
while ($x <= @array){ if ($array[$x] =~ m/$regex/){ splice @array, $x, 1; } }
The problem is that if I remove, for example, element 4 now element 5 becomes element 4 and therefore it is never checked. How can I prevent this?
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Splice not working or is it me?
by japhy (Canon) on Sep 14, 2002 at 16:42 UTC | |
by neilwatson (Priest) on Sep 14, 2002 at 16:49 UTC |