See the Conditional Operator section in the perlop manpage for more details.my $foo = "test"; print +( $foo =~ /^\w+\z/ ? "condition true" : "condition false" ),$/; my $bar = defined $x ? $x : "nought"; print "\$bar is: $bar", $/; __output__ condition true $bar is: nought
_________
broquaint
In reply to Re: ternary operator ?
by broquaint
in thread ternary operator ?
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |