Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Checking whether a $var is a number

by dragonchild (Archbishop)
on Sep 05, 2001 at 00:24 UTC ( [id://110150]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($var && $var !~ /\D/) {
        # We have a value and it's a number
    }
    
  2. or download this
    sub isNum {
        if ($var && $var !~ /\D/) {
    ...
            return 0;
        }
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2024-04-23 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found