Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Check for Positive Integer entry only

by mreece (Friar)
on May 09, 2007 at 21:59 UTC ( [id://614505]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        if ($DataEntry =~ /^[1-9][0-9]*$/) {
            print "good entry\n";
        } else {
            print "bad entry\n";
        }
    
  2. or download this
        if ($DataEntry =~ /^[0-9]+$/) {
            print "good entry\n";
        } else {
            print "bad entry\n";
        }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 19:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found