http://www.perlmonks.org?node_id=496134


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;