Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: nested loops and next

by jonnyfolk (Vicar)
on Sep 03, 2014 at 20:35 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2021-09-17 08:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found