From def3c1025d0dad82e1d840f9be58127695f1bd62 Mon Sep 17 00:00:00 2001 From: Perl 5 Porters Date: Thu, 3 Oct 1996 02:44:32 +0000 Subject: Add in stub file. --- lib/UNIVERSAL.pm | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 lib/UNIVERSAL.pm (limited to 'lib/UNIVERSAL.pm') diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm new file mode 100644 index 0000000000..c006547db0 --- /dev/null +++ b/lib/UNIVERSAL.pm @@ -0,0 +1,81 @@ +package UNIVERSAL; + +require Exporter; +@ISA = qw(Exporter); +@EXPORT_OK = qw(isa); + +1; +__END__ + +=head1 NAME + +UNIVERSAL - base class for ALL classes (blessed references) + +=head1 SYNOPSIS + + use UNIVERSAL qw(isa); + + $yes = isa($ref, "HASH"); + $io = $fd->isa("IO::Handle"); + $sub = $obj->can('print'); + +=head1 DESCRIPTION + +C is the base class which all bless references will inherit from, +see L + +C provides the following methods + +=over 4 + +=item isa ( TYPE ) + +C returns I if C is blessed into package C +or inherits from package C. + +C can be called as either a static or object method call. + +=item can ( METHOD ) + +C checks if the object has a method called C. If it does +then a reference to the sub is returned. If it does not the I +is returned. + +C can be called as either a static or object method call. + +=item VERSION ( [ REQUIRE ] ) + +C will return the value of the variable C<$VERSION> in the +package the object is blessed into. If C is given then +it will do a comparison and die if the package version is not +greater than or equal to C. + +C can be called as either a static or object method call. + +=back + +C also optionally exports the following subroutines + +=over 4 + +=item isa ( REF, TYPE ) + +C returns I if the first argument is a reference and either +of the following statements is true. + +=over 8 + +=item + +C is a blessed reference and is blessed into package C +or inherits from package C + +=item + +C is a reference to a C of perl variable (er 'HASH') + +=back + +=back + +=cut -- cgit v1.2.1