in reply to Re: How do I determine with a regular expression whether a scalar is a number/whole/integer/float?
in thread [SOLVED] How do I determine with a regular expression whether a scalar is a number/whole/integer/float?
Hello Marshall,
I want to be able to capture and understand different numbers coming in, not strings. I know that there are many examples how to check if the string is a number or an integer for example (A function to determine if a string is numeric).
I know that there are modules for this purpose (Scalar::Util).
But my goal is that I want with the use of a regular expression to determine what "category" is e.g. (integer, decimal, float).
This is the reason that I define my array my @numbers = (1, -1, 123.1, 0.1); without the qw so the values will not be strings but numbers.
Thank for you for your time and effort reading and replying to my question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do I determine with a regular expression whether a scalar is a number/whole/integer/float?
by shmem (Chancellor) on Jul 12, 2015 at 11:19 UTC |