Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: If / elses

by aardvark (Pilgrim)
on Mar 12, 2001 at 20:10 UTC ( #63833=note: print w/ replies, xml ) Need Help??


in reply to If / elses

You can use the trinary operator.
COND ? THEN : ELSE

$foo == 1 ? print "hi" : print "bye";

You can read more about trinary operators here

Get Strong Together!!


Comment on Re: If / elses

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2015-07-06 00:08 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 (68 votes), past polls