in reply to if condition problem
"I'm using the short version of the if statement"
The trinary operator does not work exactly like an if statement, thus it's no short version of it.
Here are some differences:
The trinary operator is a logical operator, not a control structure.$_ = # one statement /yes/i # conditional expression ? 'Yes' # value if cond==true : 'No' # 'else' value ; if (/yes/i) # control structure { $_='Yes' } # block is run if cond==true else { $_='No' } # 'else' block (scope!)
~Django
"Why don't we ever challenge the spherical earth theory?"
|
|---|