print "Field 1 & 2 Separate or Combined? "; chomp($_=<STDIN>); lc($_); # always sets $OPER to 'c' $_ eq 's' ? $OPER='s' : $OPER='c'; # but this works as expected: $OPER='s' if ($_ eq 's'); $OPER='c' if ($_ eq 'c');
2006-07-18 Retitled by Steve_p, as per Monastery guidelines
Original title: 'trinary operator'
In reply to ternary operator by pglenski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |