Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $size = @array; for (my $i=1; $i < @array; $i++) { if (($array[$i] <0) && ($array[$i-1] > 0)) { push @found, "$array[$i-1] $array[1]"; # want to get from $i+1 to end of array # tried: push @rest, "$array[$i+1] .. $array[$size]"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding the first element that passes a test - then saving the rest.
by broquaint (Abbot) on Jun 05, 2003 at 10:58 UTC | |
by Not_a_Number (Prior) on Jun 05, 2003 at 23:02 UTC | |
|
Re: Finding the first element that passes a test - then saving the rest.
by larsen (Parson) on Jun 05, 2003 at 11:33 UTC | |
|
Re: Finding the first element that passes a test - then saving the rest.
by particle (Vicar) on Jun 05, 2003 at 13:55 UTC | |
|
Re: Finding the first element that passes a test - then saving the rest.
by jmm (Initiate) on Jun 05, 2003 at 15:05 UTC |