in reply to Re^3: Bring back the smartmatch operator (but with sane semantics this time)!
in thread Bring back the smartmatch operator (but with sane semantics this time)!
If Perl, itself, does not internally know a value is a number, how can it convert a number to a string?
Looking at Mojo::JSON and JSON::Tiny, they both seem to be "pure Perl" implementations, so they would have to use heuristics.
Looking at perlapi:
SvNIOK "Returns a U32 value indicating whether the SV contains a number, integer or double."
So, it seems that, internally, Perl knows if a scalar is a number.