http://qs321.pair.com?node_id=325355


in reply to How to determine if something is numeric?

That actually looks pretty good. It will show non-numeric for leading/trailing spaces that perl will usually ignore. Only problem I can think of is that it may report non-numeric for something like "100000000000000000000" (because it will turn into 1e20).

When deliberately ignoring a warning, I like to isolate it to the particular warning and operation involved, like:

my $testvar = do {no warnings "numeric"; $var + 0};