in reply to Re: Re: How to check Inputs if Numeric
in thread How to check Inputs if Numeric
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...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to check Inputs if Numeric
by jdporter (Paladin) on Mar 07, 2014 at 02:58 UTC | |
|
Re^4: How to check Inputs if Numeric (eq 0+)
by tye (Sage) on Mar 07, 2014 at 03:55 UTC | |
|
Re^4: How to check Inputs if Numeric
by Anonymous Monk on Mar 16, 2014 at 11:52 UTC | |
|
Re^4: How to check Inputs if Numeric
by choroba (Cardinal) on Mar 16, 2014 at 16:11 UTC | |
|
Re^4: How to check Inputs if Numeric
by Anonymous Monk on Mar 08, 2014 at 20:00 UTC |