Could you get the result you need using List::MoreUtils before or before_incl?
So something like :-
@results = before { $_ == $target} @list;
Of course if you needed to transform the values as well you'd have to map that output
@results = map { transform($_) } before {$_ == $target} @list;
In reply to Re: Short-circuiting a map list.
by RichardK
in thread Short-circuiting a map list.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |