Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Check for Positive Integer entry only

by swampyankee (Parson)
on May 09, 2007 at 18:08 UTC ( #614465=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!perl
    
    ...
    + 1234
    
  2. or download this
    return $_[0] =~ /^\s*[\+\-]?\d+\s*$/;
    
  3. or download this
     if(( $_[0] =~ /^\s*[\+\-]?\d+\s*$/) and ($_[0] > 0)) {
        return 1;
    ...
      else{
        return undef;
      }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2023-09-21 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?