Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Short form (ternary) if else

by Bod (Parson)
on Sep 09, 2023 at 22:27 UTC ( [id://11154351]=note: print w/replies, xml ) Need Help??


in reply to Re: Short form (ternary) if else
in thread Short form (ternary) if else

The ternary operator exists in many programming languages and is often a stumbling block for many who encounter it for the first time

I must be decidedly odd - stop nodding at the back eyepopslikeamosquito - as I distinctly remember coming across the ternary operator in Perl and understanding it immediately. But at the same time thinking that I cannot see a use for it. Then, very soon afterwards I found a place where I could, and did use it...

For a while I overused it in many places where if...else would have been more appropriate. I think I have the right balance between these options now.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2026-04-20 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.