Acme-Holy

 view release on metacpan or  search on metacpan

Holy.pm  view on Meta::CPAN

then it will return the type of reference (e.g. C<SCALAR>, C<HASH>, C<CODEREF>,
etc). This means that a call to C<ref()> by itself cannot determine if a
given reference is an object. B<holy()> differs from C<ref()> by returning
C<undef> if its first argument is not a blessed reference (even if it is
a reference).

Can't we use C<UNIVERSAL::isa()>? Yes, and no. If you already have an object,
then C<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
C<isa()> through it will result in a run-time error.

B<holy()> is a quick, single test to determine if a given scalar represents
an object (i.e. a blessed reference).


=head2 EXPORT

By default, B<Acme::Holy> exports the method B<holy()> into the current
namespace. Aliases for B<holy()> (see below) may be imported upon request.

README  view on Meta::CPAN

    "CODEREF", etc). This means that a call to "ref()" by itself cannot
    determine if a given reference is an object. holy() differs from "ref()"
    by returning "undef" if its first argument is not a blessed reference
    (even if it is a reference).

    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).

  EXPORT
    By default, Acme::Holy exports the method holy() into the current
    namespace. Aliases for holy() (see below) may be imported upon request.

  Methods
    holy *scalar*



( run in 0.261 second using v1.01-cache-2.11-cpan-65fba6d93b7 )