in reply to unblessed reference

It specifically tells you that $object is not an object at all, despite the name of the variable ;-)

You can print ref($object), "\n"; to see what it actually is.