Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Check for Positive Integer entry only

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


in reply to Check for Positive Integer entry only

# +ve int, not inc zero, optional space, optional sign $var1 =~ s/^\s+//; # leading whitespace $var1 =~ s/\s+$//; # trailing whitespace if( $var1 =~ /^[+]?\d+$/ && $var1 != 0 ) { print "+ve int\n"; }
Cheers
Chris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found