print "Field 1 & 2 Separate or Combined? "; chomp($_=); 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');