I know this thread is old but it came up on google firstish. I searched, then came up with my own line, which I think works better than the regexp. I did not check all over, so most likely it is already around somewhere.
if ( $input+0 eq $input ){ print "it is a number!\n";}Can someone point out the problem with this approach? Advantage for me: easy + quick, no problems with signs...
In reply to Re^3: How to check Inputs if Numeric
by Anonymous Monk
in thread How to check Inputs if Numeric
by kasmot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |