kitwei
asked on
detect a scalar
hi, is there a way to detect a scalar whether it contains numbers or char?
thx
thx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
perldoc -q "How do I determine whether a scalar is a number/whole/integer/float "
ASKER
I don't have access to try the code until monday, and I must try it that day. I promise I will respond.
Thank you very much.
Thank you very much.
Hi kitwei,
This question is a repeat of question Q_10300771, which was asked (and answered) before this one appeared.
What test do you want to do on the data?
ozo and I assumed you wanted to know whether or not it _was_ a number, and scudweb assumed you wanted to know if it contained a digit (0-9) anywhere within it.
e.g. my test would regard "1234" and "12 34" as different, but scudweb's test would regard them as the same.
This question is a repeat of question Q_10300771, which was asked (and answered) before this one appeared.
What test do you want to do on the data?
ozo and I assumed you wanted to know whether or not it _was_ a number, and scudweb assumed you wanted to know if it contained a digit (0-9) anywhere within it.
e.g. my test would regard "1234" and "12 34" as different, but scudweb's test would regard them as the same.
I have though of a better example
"1234" and ">/34".
"1234" and ">/34".
ASKER
don't worry, I'll try all cases, I'm learning Perl, so I don't mind getting more info and giving away pts
ASKER
great, thanks