Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: What does the ternary statement actually do?

by bikeNomad (Priest)
on Aug 10, 2001 at 19:40 UTC ( #103914=note: print w/ replies, xml ) Need Help??


in reply to What does the ternary statement actually do?

The ternary just allows an expression to have one of two values based on a test. That is:

$a = 1 ? 'abc' : 'def'; # sets $a to 'abc' $a = 0 ? 'abc' : 'def'; # sets $a to 'def'


Comment on Re: What does the ternary statement actually do?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2015-07-29 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls