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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.