Randy W. Sims wrote:
Gunnar Hjalmarsson wrote:

use warnings; use Regexp::Common 'number'; $_ = '.'; /^$RE{num}{real}$/ and print "\"$_\" is a number.\n"; my $x = 1 if $_ < 5;

Outputs:
"." is a number.
"." isn't numeric in numeric lt (<) at ...

Regexp::Common considers an alone decimal point to be a number,
while the Perl compiler does not. Did you know that?  ;-)

Hrm, that's unfortunate :-/

Well, I'll still take this as an argument in favor of using modules
like Regexp::Common.

Why am I not surprised...

<argument previously stated in this thread snipped>

BTW, I've posted the following to RT:

[cpan #6940] lone . (decimal) considered a match for $RE{num}{real}
-------------------------------------------------------------------------
 perl -MRegexp::Common=number -e 'print "oops\n" if "." =~
/$RE{num}{real}/'

This was pointed out to me by Gunnar Hjalmarsson in a thread on <[EMAIL PROTECTED]> ...

Good. And thanks for giving me credit. :)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to