blessed v unblessed references

Peter Corlett abuse at
Fri May 2 11:07:08 BST 2008

On Fri, May 02, 2008 at 10:47:14AM +0100, Dirk Koopman wrote:
> How do you safely tell whether a reference is blessed or not? When I say
> safely, I mean without the runtime aborting.

The standard way is with ref(), do "perldoc -f ref". This breaks if you're
daft enough to bless things into classes called "HASH", "ARRAY" and so on,
so don't do that.

The other way is to just bless() the reference and now you know it's blessed :)

More information about the mailing list