Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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;


Comment on Re: Checking for data types
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-07-04 06:22 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 (58 votes), past polls