Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: at continue, last

by RonW (Parson)
on Jun 06, 2014 at 17:32 UTC ( [id://1089079]=note: print w/replies, xml ) Need Help??


in reply to at continue, last

Refining what InfiniteSilence said and applying to the OP examples, I'd go with:

sub part0 { ... } sub part1 { ... } if ( $condition1 ) { { part0(); last if $condition2; part1(); } --$loop; }

Then all of the condition and decrement logic is, visually, close together, so easier to understand.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found