in reply to Overloading ref() just like ->isa and ->can?

I am not sure, but I think you might be wanting Scalar::Util's blessed function. Or possibly reftype

Caution: Contents may have been coded under pressure.