Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Checking for data types

by gryphon (Abbot)
on Sep 29, 2005 at 15:10 UTC ( #496134=note: print w/replies, xml ) Need Help??


in reply to Checking for data types

Greetings,

You could do a regex to check that there aren't any non-digit characters. Just replace your elsif conditional with this:

elsif ($salt !~ /\D/) {

But looking at your example, do you want something a little bit more specific? Do you want only numbers in a particular range?

gryphon
Whitepages.com Development Manager (DSMS)
code('Perl') || die;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://496134]
help
Chatterbox?
[atcroft]: stevieb: I have a quick question for you, actually, if you are still around.
[atcroft]: stevieb: I have berrybrew installed on a Win machine, and I noticed that with perlbrew you can "upgrade" a particular installed version... any chance of doing something similar in the
[atcroft]: future with berrybrew?

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-04-29 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.