moot has asked for the wisdom of the Perl Monks concerning the following question:

Am I missing something, or is there really no easy way to tell if $foo is blessed other than the unwieldy

$is_blessed = ref $obj && UNIVERSAL::isa($obj, 'UNIVERSAL');
and without falling afoul of trying to call $obj->isa where $obj might be unblessed?

Replies are listed 'Best First'.
Re: is_object_blessed($foo)
by Limbic~Region (Chancellor) on Jan 20, 2005 at 00:43 UTC
      Oy. Exactly what I was looking for. Thanks to all respondents.
Re: is_object_blessed($foo)
by revdiablo (Prior) on Jan 20, 2005 at 00:44 UTC
Re: is_object_blessed($foo)
by borisz (Canon) on Jan 20, 2005 at 00:44 UTC
    use Scalar::Util; my $is_blessed = blessed $obj;
    Boris