See Scalar::Util::looks_like_number

That checks if a scalar looks like a real.

If you're using Moose, of course, then you use the "Int" or "Num" types of course, if you want to be more specific.

Just a thought, would this be acceptable, assuming it worked?

use Moose::Autobox;
if ($object->isa("Num")) {
...
}