[Chicago-talk] Scalar help.
Brian Katzung
briank at kappacs.com
Mon May 7 07:11:35 PDT 2007
If this is for a *NIX-style system, you might want to consider TIOCSTI
(simulate typed input) in tty_ioctl(4).
Richard Reina wrote:
> Good Morning,
>
> Hope everybody had a great weekend.
>
> I have a little program called query_aid.pl that helps users here on
> are land enter information more easily by matching scalar choices as
> they are matched. For example if a user begins typing the name
> "lincoln" it will begin showing him the matches as he types and
> eliminating records that no longer match with each successive letter
> that is typed. The program uses readkey to see if the user has typed
> a number. A number means that the user is attempting to make a
> selection by typing in one of they corresponding numbers for a
> displayed record. The program has worked great for years except for
> one annoying inconvenience. It deals with adding the first number
> typed for the selection in the following way:
>
> if ($char > 0) { #it's numeric, they're making a selection
> ReadMode 'normal';
> print $char;
> chomp ($choice = <STDIN>);
> $choice = $char . $choice;
> }
>
> Accordingly, if the user accidentally types the wrong first digit of
> the number (selection) the user cannot backspace and erase the first
> digit of the selection ($char) and retype it, but instead has to start
> over. Is there a way to make $char accessible to the user so they can
> backspace and erase it if they made a mistake?
>
> Thanks for considering my quandary.
>
> Richard
--
Brian Katzung
Kappa Computer Solutions, LLC
www.kappacs.com 877.367.8837 x1
More information about the Chicago-talk
mailing list