you could use Scalar::Utils looks_like_number:
Edit: "enhanced" the code-snippet, declaring the tested variable...use Scalar::Util qw(looks_like_number); my $myval = someKindOfUserInput(); # jepp, I'm mostly into java here @ +work ,) [...] if (looks_like_number($myval)) { # a number, maybe even Inf or somesuch thing } [...]
regards,
tomte
Hlade's Law:
If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.
In reply to Re: How to check Inputs if Numeric
by Tomte
in thread How to check Inputs if Numeric
by kasmot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |