Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Reading an array with a single value (My 2nd completed script!)

by Maclir (Curate)
on Oct 01, 2001 at 18:05 UTC ( [id://115871]=note: print w/replies, xml ) Need Help??


in reply to Reading an array with a single value (My 2nd completed script!)

An alternative to the
if ($in > $numb) { print "Too high! "; }else{ print "Too low! "; }
construct is to use the trinary operator:
print 'Too ', ($in > $numb) ? 'high!' : 'low!';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found