in reply to Is there a way to find out what kind of ref an object is?

Some recent nodes about inside-out objects got me thinking about how to find out about the implementation of a regular object.

If you have to ask, you're probably doing something scary and probably dangerous. The purpose of inside-out objects is to prevent you from doing such dangerous things accidentally.

For curiosity's sake, reftype() is the most accurate approach, though heed ysth's example carefully. The documentation is the best place to learn what you can and cannot and should and should not do with an object.

Replies are listed 'Best First'.
Re^2: Is there a way to find out what kind of ref an object is?
by johnnywang (Priest) on Dec 07, 2005 at 02:12 UTC
    well, exactly, it's dangerous. My impression of the purpose of inside-out objects is to prevent users from messing up the contents of hashref in the implementation, which I assume means directly change the content via the object reference, and to do that one needs to know its type (reference of hash, array, scalar , etc.), hence my original question.