Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: in search of a more elegant if then else

by toolic (Bishop)
on Feb 18, 2010 at 23:53 UTC ( [id://824061]=note: print w/replies, xml ) Need Help??


in reply to in search of a more elegant if then else

The Conditional Operator is another way. You should decide, on a case-by-case basis, if it is better than an if/else.
my $var = (condition) ? value1 : value2;

Log In?
Username:
Password:

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

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

    No recent polls found