# determine whether a field is numeric, alpha or alphanumeric

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on

is their a function or way to determine whether a field, or variable
for that matter, is numeric, alpha or alphanumeric?

## Re: determine whether a field is numeric, alpha or alphanumeric

perldoc -q 'is a number' leads to "How do I determine whether a scalar
is a number/whole/integer/float?".  Please check the FAQ before posting.

Anno

## Re: determine whether a field is numeric, alpha or alphanumeric

that finds out if a scaler is a number or not. i want to see if there
is a way to find out if its am alphanumeric, so contains both alphabets
and numbers and maybe punctuation

## Re: determine whether a field is numeric, alpha or alphanumeric

Yes, there is a way.

Use regular expressions and the match operator.

perldoc perlrequick
perldoc perlretut
perldoc perlre

perldoc -f m
perldoc perlop

--
Fort Worth, Texas

## Re: determine whether a field is numeric, alpha or alphanumeric

: that finds out if a scaler is a number or not. i want to see if there
: is a way to find out if its am alphanumeric, so contains both alphabets
: and numbers and maybe punctuation

So take the answer from the FAQ, apply two grams of brain power and call
again if your solution does not give the desired results.

P

## Re: determine whether a field is numeric, alpha or alphanumeric

damn  this is a hostile group

## Re: determine whether a field is numeric, alpha or alphanumeric

No, this is a group where people are expected to expend a little
of their own effort before asking hundreds of others to spend
effort on their behalf.

We help people fix Perl code, we don't generally write their
Perl code for them.

Take your best shot at solving your problem, and if it doesn't work,

--
Fort Worth, Texas

## Re: determine whether a field is numeric, alpha or alphanumeric

i appreciate you pointing me in the right direction....

## Re: determine whether a field is numeric, alpha or alphanumeric

Who pointed you in the right direction?

Please quote some context in followups like everybody else does.

--