Peter Scott wrote:
>
> Have often wanted a way to tell whether a scalar was a number, and rolling
> a regex each time seemed wasteful given that Perl knew what it was
> anyway. So a user-friendly way to get at the SvIOK and SvNOK results would
> be great.
>
> The pedestrian way would be a builtin: isnum() or similar. But we have
> enough creativity here I'm sure we can come up with something far more
> obfusc^Wconcise :-)
Agree here. I've seen people resort to DBI.pm's 'looks_like_number' or
using tricks like ($a + 0 eq $a), but really this should be easier.
Having said that, it doesn't need to live in the core - and even today
it should be relatively easy to write an XS module for this.
Hildo