my @found; for (0 .. $#array) { if ($array[$_] < 0 and $array[$_ - 1] > 0) { @found = @array[$_ .. $#array]; last; } }
_________
broquaint
In reply to Re: Finding the first element that passes a test - then saving the rest.
by broquaint
in thread Finding the first element that passes a test - then saving the rest.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |