At 08:31 PM 8/7/00 +0100, Hildo Biersma wrote:
>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.

Hmm.  It seems pretty core-ish to me, but if you're thinking frequency of 
use, I agree.  I thought I'd mention it here in case it turns out to fall 
out naturally of one of Damian's mind-twisting syntactical voyages of 
discovery.


--
Peter Scott
Pacific Systems Design Technologies

Reply via email to