in reply to Question re numbers and strings

You might find Scalar::Util's looks_like_number useful.