use Term::ReadKey; my $prompt = "Gimme a char: "; while (1) { # updated to use the erase-to-EOL escape sequence print "\r$prompt\e[K"; my $key = ""; my $str = ""; ReadMode "cbreak"; do { print $key; $str .= $key; $key = ReadKey; } while $key ne "\n"; ReadMode "normal"; }
In reply to Re^5: Avoid newline echoing so I can capture a line and reprompt over it
by japhy
in thread Avoid newline echoing so I can capture a line and reprompt over it
by hlen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |