<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package UNIVERSAL;

# UNIVERSAL should not contain any extra subs/methods beyond those
# that it exists to define. The use of Exporter below is a historical
# accident that should be fixed sometime.
require Exporter;
*import = \&amp;Exporter::import;
@EXPORT_OK = qw(isa can);

1;
__END__

=head1 NAME

UNIVERSAL - base class for ALL classes (blessed references)

=head1 SYNOPSIS

    $io = $fd-&gt;isa("IO::Handle");
    $sub = $obj-&gt;can('print');

    $yes = UNIVERSAL::isa($ref, "HASH");

=head1 DESCRIPTION

C&lt;UNIVERSAL&gt; is the base class which all bless references will inherit from,
see L&lt;perlobj&gt;

C&lt;UNIVERSAL&gt; provides the following methods

=over 4

=item isa ( TYPE )

C&lt;isa&gt; returns I&lt;true&gt; if C&lt;REF&gt; is blessed into package C&lt;TYPE&gt;
or inherits from package C&lt;TYPE&gt;.

C&lt;isa&gt; can be called as either a static or object method call.

=item can ( METHOD )

C&lt;can&gt; checks if the object has a method called C&lt;METHOD&gt;. If it does
then a reference to the sub is returned. If it does not then I&lt;undef&gt;
is returned.

C&lt;can&gt; can be called as either a static or object method call.

=item VERSION ( [ REQUIRE ] )

C&lt;VERSION&gt; will return the value of the variable C&lt;$VERSION&gt; in the
package the object is blessed into. If C&lt;REQUIRE&gt; is given then
it will do a comparison and die if the package version is not
greater than or equal to C&lt;REQUIRE&gt;.

C&lt;VERSION&gt; can be called as either a static or object method call.

=back

The C&lt;isa&gt; and C&lt;can&gt; methods can also be called as subroutines

=over 4

=item UNIVERSAL::isa ( VAL, TYPE )

C&lt;isa&gt; returns I&lt;true&gt; if one of the following statements is true.

=over 8

=item *

C&lt;VAL&gt; is a reference blessed into either package C&lt;TYPE&gt; or a package
which inherits from package C&lt;TYPE&gt;.

=item *

C&lt;VAL&gt; is a reference to a C&lt;TYPE&gt; of Perl variable (e.g. 'HASH').

=item *

C&lt;VAL&gt; is the name of a package that inherits from (or is itself)
package C&lt;TYPE&gt;.

=back

=item UNIVERSAL::can ( VAL, METHOD )

If C&lt;VAL&gt; is a blessed reference which has a method called C&lt;METHOD&gt;,
C&lt;can&gt; returns a reference to the subroutine.   If C&lt;VAL&gt; is not
a blessed reference, or if it does not have a method C&lt;METHOD&gt;,
I&lt;undef&gt; is returned.

=back

These subroutines should I&lt;not&gt; be imported via S&lt;C&lt;use UNIVERSAL qw(...)&gt;&gt;.
If you want simple local access to them you can do

  *isa = \&amp;UNIVERSAL::isa;

to import isa into your package.

=cut
</pre></body></html>