Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: "return" to break out of a loop

by jettero (Monsignor)
on May 13, 2008 at 14:29 UTC ( [id://686274]=note: print w/replies, xml ) Need Help??


in reply to "return" to break out of a loop

There's nothing wrong with it. It's not only common practice, but it's an efficient way to break out of a loop and return a value (shortcutting the rest of the function logic). It's probably correct. I suppose there are places where it's bad to do it, but nothing comes to mind.

-Paul

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://686274]
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:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found