in reply to if condition problem
should do it. It's because "=" has higher precedence than "?:" (see perldoc perlop). This should also work:
$_ = /yes/i ? 'Yes' : 'No';update: The ?: is called the conditional operator. It is a ternary operator because it has 3 arguments.
|
|---|