Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yes, it's documented in perlapi. I didn't assume that would be a concern for the OP. The old pure-Perl version of Scalar::Util has a pure-Perl version of looks_like_number, which includes the following code:
So if we wanted to eliminate that behavior, we could either copy/paste and modify the entire pure-Perl version from an old version of Scalar::Util (but it has issues with '0 but true'), or use the modern version of Scalar::Util::looks_like_number like this:
Or, in perlfaq4 there is a series of regexes given for determining if one is looking at a number under the section, "How do I determine whether a scalar is a number/whole/integer/float? It's not pretty, and that FAQ answer has even changed over the years; it used to use a bunch of "if" statements. Now it uses given/when. *sigh* Dave In reply to Re^3: storage of numbers
by davido
|
|