I don't know what I could be doing wrong with this simple transaction, but it's not working:
print "OK? (y or n)\n";
$ans = <>;
print "\n";
if($ans eq "y"){print $ans;}
I basically want to know how to test the user input. This little bit of code won't work for me. I'm just trying to print $ans
if y
is entered by the user.
Any suggestions?
EDIT: - I have also tried single quotes