spx2 has asked for the wisdom of the Perl Monks concerning the following question:
On this piece of code
$a = 3; do { last unless $a == 4; } while ( 1 );
I get Can't "last" outside a loop block at /tmp/test.pl line 3. Is this the expected behaviour for "last" ?
My perl version is v5.10.0 built for i486-linux-gnu-thread-multi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "last" not really outside loop block
by ikegami (Patriarch) on Jun 22, 2009 at 15:40 UTC | |
by spx2 (Deacon) on Jun 22, 2009 at 15:59 UTC | |
by ikegami (Patriarch) on Jun 22, 2009 at 16:15 UTC | |
|
Re: "last" not really outside loop block
by BrowserUk (Patriarch) on Jun 22, 2009 at 16:25 UTC | |
by Limbic~Region (Chancellor) on Jun 22, 2009 at 16:43 UTC | |
by ikegami (Patriarch) on Jun 22, 2009 at 17:01 UTC | |
by BrowserUk (Patriarch) on Jun 22, 2009 at 17:02 UTC | |
|
Re: "last" not really outside loop block
by mscharrer (Hermit) on Jun 22, 2009 at 15:50 UTC | |
by spx2 (Deacon) on Jun 22, 2009 at 15:55 UTC | |
by mscharrer (Hermit) on Jun 22, 2009 at 15:59 UTC |