Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Short form (ternary) if else

by InfiniteSilence (Curate)
on Feb 08, 2012 at 19:58 UTC ( #952569=note: print w/ replies, xml ) Need Help??


in reply to Short form (ternary) if else

perl -e 'my $n = 10; (1)? $n++ : $n--; print qq~This is $n\n~;'
Prints:
This is 11

Celebrate Intellectual Diversity


Comment on Re: Short form (ternary) if else
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (17)
As of 2015-07-29 15:18 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