in reply to [SOLVED] How do I determine with a regular expression whether a scalar is a number/whole/integer/float?
The output you've posted did not come from the code that you posted.
Running the code you posted, (second code block) under 5.10 and 5.18 I get this output:
The 1 is a whole number The 1 is a whole number The 123.1 has nondigits The 0.1 has nondigits
I suspect the code you actually ran to get the output you posted included:
my @numbers = qw(1, 1.0, 123.1, 0.1);
And did not have warnings enabled.
But that doesn't explain all the differences.
Try posting the actual code you run; and the actual output you get.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I determine with a regular expression whether a scalar is a number/whole/integer/float?
by thanos1983 (Parson) on Jul 12, 2015 at 00:08 UTC |