in reply to Finding the first element that passes a test - then saving the rest.
my @found; for (0 .. $#array) { if ($array[$_] < 0 and $array[$_ - 1] > 0) { @found = @array[$_ .. $#array]; last; } }
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding the first element that passes a test - then saving the rest.
by Not_a_Number (Prior) on Jun 05, 2003 at 23:02 UTC |