You should use it like it's shown in the perldoc perlop:
$a = $condition ? 2 : 3; print $a;
In reply to Re: Why does the Perl conditional operator not do what I expect?
by linuxer
in thread Why does the Perl conditional operator not do what I expect?
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |