[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [ID 20000125.009] bad interaction between 'next' and raw scope levels
On Tue, Jan 25, 2000 at 09:49:52PM -0800, Jonathan Cox wrote:
> for (my $i=0; $i<3; $i++)
> {
> { # new "raw" scoping level
> if ($i == 1)
> {
> next; # executes, but does not skip
> } # the print statement! Boo hoo!
> }
> print "index: $i\n";
> }
>
As documented in perlsyn. Bare blocks, with optional labels, are loops
that execute once. Loop control statements apply to them.
Ronald
- References to:
-
Jonathan Cox <jcox@newton.interwoven.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]