in reply to non numeric data

You might want to take a look at Scalar::Util::looks_like_number

see http://perldoc.perl.org/Scalar/Util.html