Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: alternatives to if and series of elsif

by kiat (Vicar)
on Jul 03, 2005 at 11:11 UTC ( [id://472009]=note: print w/replies, xml ) Need Help??


in reply to Re^5: alternatives to if and series of elsif
in thread alternatives to if and series of elsif

Thanks, gsiems!

I did a lazy test prior to your posting above on my while version and, as shown by your automated test, it didn't produce the expected results. The base_points are incremented as long as the condition is true and are returned regardless of the status of the final test, which is the crucial one.

I like your ternary version because it's relatively easy to understand. It also tends to be faster as the points go up.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-03-28 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found