--- [EMAIL PROTECTED] wrote:
> help list but for now I'm stumped. How do I test an input to see if
> it is a real number?  I have a situation something like:

By "real number", exactly what do you mean?
Do you mean a decimal fraction without characters other than
0123456789.+- or do you want to include E for exponentiation? Is
whitespace allowed before or after?

There are several ways to test it, but a lot of them break easily.

You could just say

>   $input = <STDIN>;
>       chomp $input;
    unless ($input =~ /\D/) {

which would allow integers, but whitespace, decimals, commas, or signs
would all fail. More complex patterns could test all that, but is that
what you want?

Can you give us specs for the desired behavior? =o)

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to