Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Check for Positive Integer entry only

by mreece (Friar)
on May 09, 2007 at 21:59 UTC ( #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? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2023-06-05 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (22 votes). Check out past polls.

    Notices?