Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Multiple if-else statements using C-style ternary operator

by james2vegas (Chaplain)
on Jul 11, 2011 at 22:41 UTC ( #913792=note: print w/ replies, xml ) Need Help??


in reply to Multiple if-else statements using C-style ternary operator

This should be enough:

print $status == 2 ? "HIGH " : $status == 1 ? "MODERATE " : "LOW ";


Comment on Re: Multiple if-else statements using C-style ternary operator
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-08-22 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (147 votes), past polls