On Mon, 2003-06-16 at 09:27, Tim Bunce wrote:
> On Mon, Jun 16, 2003 at 04:31:06AM +0200, Perl Authors Upload Server wrote:
> > 
> >     Can't we use UNIVERSAL::isa()? Yes, and no. If you already have an
> >     object, then isa() will let you know if it inherits from a given
> >     class. But what do we do if we know nothing of the inheritance tree
> >     of the object's class? Also, if we don't have an object, just a
> >     normal reference, then attempting to call isa() through it will
> >     result in a run-time error.
> 
> >     holy() is a quick, single test to determine if a given scalar
> >     represents an object (i.e. a blessed reference).
> 
> Is there a problem with this:
> 
>   $class = UNIVERSAL::isa( $foo, "UNIVERSAL") ? ref $foo : undef;

Also, there is Scalar::Util::blessed

Graham.

> (And the Acme:: category isn't for "typically useful" modules :)
> 
> Tim.
> 

Reply via email to