PerlOnTheWay has asked for the wisdom of the Perl Monks concerning the following question:
X: { print "hello\n"; next X; }
I thought next is just another way to say goto,
and I was expecting the above code to go into infinite loop, but actually the block only executes once.
How does next label work actually?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How does next label work?
by LanX (Saint) on Jan 06, 2013 at 09:49 UTC | |
|
Re: How does next label work?
by moritz (Cardinal) on Jan 06, 2013 at 10:04 UTC | |
|
Re: How does next label work?
by 7stud (Deacon) on Jan 06, 2013 at 10:22 UTC | |
|
Re: How does next label work?
by locked_user sundialsvc4 (Abbot) on Jan 07, 2013 at 22:42 UTC | |
by LanX (Saint) on Jan 07, 2013 at 23:05 UTC | |
by eyepopslikeamosquito (Archbishop) on Jan 08, 2013 at 08:19 UTC | |
by locked_user sundialsvc4 (Abbot) on Jan 09, 2013 at 01:38 UTC |