Because firstidx returns -1 if the test block never evaluates true, a test is needed avoid returning all elements if the looked-for element is not found:
my $from = firstidx {$_ eq $look_for} @array;
return unless $from > -1;
return @array[$from+1..$#array];
In reply to Re^2: flip-flop flop
by AnomalousMonk
in thread flip-flop flop
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |