In numeric context, perl will not warn if a number matches
something like:
/^(?:
0\ but\ true |
(?:
\s* # leading spaces ignored
[-+]? # optional sign
(?:
(?i: inf|infinity|nan ) | # any case of inf or nan
(?: \d+ (?:\.\d*)? | \.\d+ ) # digits, optional .
(?: [eE] [-+]? \d+ )? # optional exponent
)
\s* # trailing spaces (including "\n")
)
)\z
/x;
The case you are hitting is the "trailing spaces" being silently ignored.
If compiled with numeric locale support, either . or the
locale's radix will work.