Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Control Flow - Multiple returns or nested conditionals

by halfcountplus (Hermit)
on Oct 07, 2010 at 15:53 UTC ( #864023=note: print w/replies, xml ) Need Help??


in reply to Control Flow - Multiple returns or nested conditionals

I don't see anything wrong with either one, altho I tend toward the first one. (In fact, what I might do would be to define a populated return hash first, then modify it as necessary -- kind of like the 2nd example -- but within the if...return structure of the first example). If I had to defend this, I'd point out:

  • It's simpler and perhaps more clear.
  • It's probably more efficient.
  • Comment on Re: Control Flow - Multiple returns or nested conditionals

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2021-07-29 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?