I am unable to (and, frankly, didn't expect to be able to) reproduce your problem in isolation. I tried this:
$ perl -e 'print "X: "; my $x = <STDIN>; print "X=", $x'
Regardless, of whether I terminate the input with <Enter>, Ctrl-J (newline) or Ctrl-M (carriage return), it works fine:
$ perl -e 'print "X: "; my $x = <STDIN>; print "X=", $x' X: 123 X=123 $
Adding '$|=0;' or '$|=1;', as the first statement, makes no difference: I get the same result as above (regardless of how I terminate the input).
Try what I did and see how you go. If it works OK, then there's probably something else in your code causing the problem; if it's still not working, look for issues with whatever shell you're running, non-standard keymapping, hardware problems (perhaps try starting a new shell or even rebooting).
— Ken
In reply to Input problem with Enter key...
by kcott
in thread Input problem with Enter key...
by PriNet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |