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 taking refuge in the Monastery: (3)
As of 2017-12-15 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (415 votes). Check out past polls.

    Notices?