in reply to Re^4: Short-circuiting a map list. (This works! But ...)
in thread Short-circuiting a map list.
do does say "do BLOCK" does *not* count as a loop,
I don't think that is relevant as it is the anonymous block inside the do block that is the target of the last?
I can also get the same output with the same weirdness whilst avoiding the do block:
sub b{ my $x = shift; goto sub { { print 'ba'; map { print 'bb'; last if $_ == $x; $_; } @_; print 'bc'; } }; } my @data = 0 .. 9; print for b( 5, @data );
I am completely at a loss to explain the return values being stacked on top of the passes values?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Short-circuiting a map list. (This works! But ...)
by Anonymous Monk on Oct 08, 2011 at 15:49 UTC |