Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Check for Positive Integer entry only

by kyle (Abbot)
on May 09, 2007 at 17:33 UTC ( [id://614458]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $dataEntry =~ m{ \A   # beginning of string
                     \+?  # optional plus sign
                     \d+  # one or more digits
                     \z   # end of string
                   }xms
    
  2. or download this
    use Regexp::Common qw( number );
    $dataEntry =~ /$RE{num}{int}/ && $dataEntry == abs $dataEntry
    
  3. or download this
    m{ \A      # beginning of string
       \+?     # optional plus sign
    ...
       [0-9]*  # optional digits, including zero
       \z      # end of string
     }xms
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-20 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found