in reply to Re: How do I query the package name of an object?
in thread How do I query the package name of an object?

Most of the time ref() will do but here is also blessed() in Scalar::Util that does there same as ref() for objects but returns undef for references to unblessed things.

Condider also if you'd be better off using UNIVERSAL::isa which given an object and a package tells you if the object can be treated as being of the class defined by that package (including any subclasses).