In Perl, how do I use the next
statement? In all sample programs I see the statement expressed like this: next LINEP
I do not understand what that label is doing. Can any one help me with an easily understandable example?
In Perl, how do I use the next
statement? In all sample programs I see the statement expressed like this: next LINEP
I do not understand what that label is doing. Can any one help me with an easily understandable example?
Have a look of next LABEL.
It would be nice if you read the
topic Loop labels from Chapter 6 Control Structures in
Perl Best Practices by Damian Conway
that will explain you "Label every
loop that is exited explicitly and
use the label with every 'next', last
or redo".
Then you will come to know why and how to use next command with Label.
As the good book states, next is used to start the next iteration of a loop. The loop being referenced in your example will have the label LINEP where the loop begins.