Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: A function to determine if a string is numeric

by toolic (Bishop)
on Feb 24, 2012 at 00:46 UTC ( #955847=note: print w/ replies, xml ) Need Help??


in reply to A function to determine if a string is numeric

Scalar::Util::looks_like_number

This is also a FAQ: perldoc -q number

use warnings; use strict; use Scalar::Util qw(looks_like_number); my $s = shift; if (looks_like_number($s)) { print "$s is a number\n"; } else { print "$s isn't a number\n"; }


Comment on Re: A function to determine if a string is numeric
Select or Download Code
Re^2: A function to determine if a string is numeric
by juliosergio (Acolyte) on Feb 24, 2012 at 00:56 UTC

    Hey! Thanks!
    -Sergio

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955847]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (16)
As of 2015-07-02 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (45 votes), past polls