Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: How to check if a scalar value is numeric or string?

by ibravos (Initiate)
on Mar 09, 2012 at 11:02 UTC ( #958679=note: print w/replies, xml ) Need Help??


in reply to Re: How to check if a scalar value is numeric or string?
in thread How to check if a scalar value is numeric or string?

Correction: isnum('') returns 1, so here is a better version
sub isnum ($) { return 0 if $_[0] eq ''; $_[0] ^ $_[0] ? 0 : 1 }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://958679]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-07-17 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (378 votes). Check out past polls.

    Notices?