in reply to ternary operator

The real cause of the problem is that the '=' operator is being allowed to execute from left to right in a way that disrupts the ternary operator. Putting brackets around each of the three arguments to the ternary operator forces the correct precedence (although still abusing the operator).
( $_ eq 's' ) ? ( $OPER = 's' ) : ( $OPER = 'c' ); # still cringeing
It is more normal to use these arguments to return the conditional values to an assignment rather than assign values inside the arguments, i.e. this would be a more normal way:
# </cringe> $OPER = ( $_ eq 's' ) ? 's' : 'c';

-M

Free your mind