how do make certain that no input (keyboard + mouse paste) is outside of 7-bit ASCII in a perl script?



Hi;

how do make certain that no input (keyboard + mouse paste) is outside
of 7-bit ASCII in a perl script?

Since I have no intention of correctly or completely handling input
that is outside of 7-bit ASCII, I thought it would be best to prevent
any characters outside of 7-bit ASCII from being input.

How best to do this?

I want to keep it simple.

Are there specific pragmas and/or modules that I can use to force this?

I'm looking at Programming Perl (3rd Edition), Perl Cookbook (2nd
Edition), cpan.org, etc, and I'm finding lots of stuff but it is
either too much (need some guidance) or not quite what I'm looking for
(confusing).

Let's say that I have only two kinds of prompted input:Yes/No question
and one numeric capturing regex.

If I compare the first letter of the response being either "Y" or "y"
then I can assume that any other response was a negative, even if it
was a 16-bit Unicode character?

Secondly, if I literally compare against digits and whitespace in my
capturing numeric regex, then anything outside of that I can
categorically reject?

Looking for the fishing pole more than the fish.

Thanks,
Ken Wolcott
.



Relevant Pages

  • RE: Pattern Match
    ... Rob, can you explain the details of that replace? ... > I am very new to Perl, but I sense a great adventure ahead after just ... not a list of characters. ... to the ASCII value of the control character grabbed by the regex. ...
    (perl.beginners)
  • Re: Tk und locale
    ... dass das irgendein Superset von ASCII sein muss, ... Wenn du also eine Operation wie ucor $str ... dann ist es ein Bug. ... schickt jede Menge Patches an die perl 5 porter. ...
    (de.comp.lang.perl.misc)
  • Re: Trying to read a multiline string
    ... In this format, Perl can read it, no problem. ... Is this an ascii representation of a binary line of data? ... code for endline is used to represent a number in binary data. ...
    (perl.beginners)
  • Re: Sort collating sequence
    ... But, Perl uses the ASCII ... collating sequence when comparing strings. ... > The system's default behavior is to sort punctuation first, ...
    (microsoft.public.windowsxp.help_and_support)
  • error in printing unicode
    ... I just finished reading "Beginning Perl by Simon Cozens Chapter 1: First Steps In Perl" and i tried to print a Unicode character using the \xbut i got a strange outcome i don't understand. ...
    (perl.beginners)