in reply to Re^2: Short-circuiting a map list. (This works! But ...)
in thread Short-circuiting a map list.
Okay. If what you are telling me is that I am utilising unspecified behaviour, then how about this version which produces identical output but, as far as I can tell, does nothing that is either prohibited or unspecified?
sub a{ my $x = shift; return do{ { print 'a'; map { print 'b'; last if $_ == $x; $_; } @_; print 'c'; } }; } my @data = 0 .. 9; print for a( 5, @data );
Does that mean uncovered an obscure bug?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Short-circuiting a map list. (This works! But ...)
by Anonymous Monk on Oct 08, 2011 at 15:33 UTC | |
by BrowserUk (Patriarch) on Oct 08, 2011 at 15:40 UTC | |
by Anonymous Monk on Oct 08, 2011 at 15:49 UTC | |
|
Re^4: Short-circuiting a map list. (This works! But ...)
by ikegami (Patriarch) on Oct 08, 2011 at 18:15 UTC | |
by BrowserUk (Patriarch) on Oct 08, 2011 at 18:29 UTC | |
by ikegami (Patriarch) on Oct 09, 2011 at 05:18 UTC | |
by BrowserUk (Patriarch) on Oct 09, 2011 at 15:11 UTC | |
by ikegami (Patriarch) on Oct 09, 2011 at 19:18 UTC | |
|