Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: nested loops and next

by jonnyfolk (Vicar)
on Sep 03, 2014 at 20:35 UTC ( [id://1099471]=note: print w/replies, xml ) Need Help??


in reply to nested loops and next

Thanks very much. I haven't come across labelling before, I'll check it out!!

Replies are listed 'Best First'.
Re^2: nested loops and next
by AppleFritter (Vicar) on Sep 03, 2014 at 21:01 UTC

    You're welcome! Labels are discussed in Compound Statements in perlsyn, BTW:

    The LABEL is optional, and if present, consists of an identifier followed by a colon. The LABEL identifies the loop for the loop control statements next, last, and redo. If the LABEL is omitted, the loop control statement refers to the innermost enclosing loop.

    Contrary to what that document appears to imply, though, labels can be used on any statement; outside of loops, you'll want to use goto to jump to them. (Or perhaps not want to, if you're a monk of the Dijkstraian persuasion.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1099471]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found