12 UNIVERSAL - base class for ALL classes (blessed references)
16 use UNIVERSAL qw(isa);
18 $yes = isa($ref, "HASH");
19 $io = $fd->isa("IO::Handle");
20 $sub = $obj->can('print');
24 C<UNIVERSAL> is the base class which all bless references will inherit from,
27 C<UNIVERSAL> provides the following methods
33 C<isa> returns I<true> if C<REF> is blessed into package C<TYPE>
34 or inherits from package C<TYPE>.
36 C<isa> can be called as either a static or object method call.
40 C<can> checks if the object has a method called C<METHOD>. If it does
41 then a reference to the sub is returned. If it does not then I<undef>
44 C<can> can be called as either a static or object method call.
46 =item VERSION ( [ REQUIRE ] )
48 C<VERSION> will return the value of the variable C<$VERSION> in the
49 package the object is blessed into. If C<REQUIRE> is given then
50 it will do a comparison and die if the package version is not
51 greater than or equal to C<REQUIRE>.
53 C<VERSION> can be called as either a static or object method call.
57 C<UNIVERSAL> also optionally exports the following subroutines
61 =item isa ( REF, TYPE )
63 C<isa> returns I<true> if the first argument is a reference and either
64 of the following statements is true.
70 C<REF> is a blessed reference and is blessed into package C<TYPE>
71 or inherits from package C<TYPE>
75 C<REF> is a reference to a C<TYPE> of perl variable (er 'HASH')