in reply to Short-circuiting a map list.
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;
|
|---|