in reply to Short-circuiting a map list.

FWIW map in Perl 6 supports last

$ perl6 -e 'my @out = (1..5).map: { $_ == 3 and last }; say @out.perl' Array.new(False, False)

Replies are listed 'Best First'.
Re^2: Short-circuiting a map list.
by ikegami (Patriarch) on Oct 08, 2011 at 06:39 UTC
    Earlier, I tried using last from a map reimplementation (since it's possible to exit a sub using last) but some AV was getting left on the stack (bizarre copy of array).