in reply to Re: Short-circuiting a map list. (This works! But ...)
in thread Short-circuiting a map list.
In 5.12.2 I get as you, 0,1,2,3,4,5,6,7,8,9, with 0,1,2,3,4
If I explicitly add return map{} I get only 0,1,2,3,4,5,6,7,8,9, without 0,1,2,3,4
In perl 5.6 I get 0,1,2,3,4,5,6,7,8,9, without 0,1,2,3,4
In perl 5.14.1 I get 0,1,2,3,4,5,6,7,8,9, BUT with 0,0,0,0
perlsub says: If no return is found and if the last statement is an expression, its value is returned. If the last statement is a loop control structure like a foreach or a while , the returned value is unspecified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Short-circuiting a map list. (This works! But ...)
by BrowserUk (Patriarch) on Oct 08, 2011 at 15:21 UTC | |
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 | |
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 | |
|