Safer Polymorphism with UNIVERSAL Another option is to check if the object has the method before calling it. All objects inherit implicitly from a class called UNIVERSAL, which provides a handful of methods: if ($object->can("foo")) { print $object->foo; } else { warn "Your object can't even foo"; } In addition to can, it also provides isa, which allows you to check whether an object "is a" certain thing.