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 chrism01 (Friar)
on May 09, 2007 at 22:59 UTC ( #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? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2023-09-21 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?