Fetching input character without newline?
- From: "Mark" <anon40629@xxxxxxxxxxx>
- Date: Sun, 19 Nov 2006 14:18:02 -0800
Good afternoon.
I am attempting to solicit user input using the following:
while ()
{
print "Enter your response here (1-5): ";
$ret = <STDIN>;
if ($ret =~ /^([1-5])$/)
{print "\nUser chose $1\n";
last;
}
}
This code reprints the prompt string on the next line each time
the user responds incorrectly. I would _like_ to handle an incorrect
response by erasing the user's entry and leaving the prompt in place
on the current line.
Any suggestions on how to do this?
Thanks
-Mark
.
- Follow-Ups:
- Re: Fetching input character without newline?
- From: robertospara
- Re: Fetching input character without newline?
- From: anno4000
- Re: Fetching input character without newline?
- Prev by Date: Re: Do I *have* to use 'OOP' to use modules?
- Next by Date: Re: Do I *have* to use 'OOP' to use modules?
- Previous by thread: context sensitive grammar?
- Next by thread: Re: Fetching input character without newline?
- Index(es):
Relevant Pages
|