- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

16.6 Default UNIVERSAL methods

The UNIVERSAL package automatically contains the following methods that are inherited by all other classes:

isa(CLASS)
isa returns true if its object is blessed into a subclass of CLASS
DOES(ROLE)
DOES returns true if its object claims to perform the role ROLE. By default, this is equivalent to isa.
can(METHOD)
can checks to see if its object has a method called METHOD, if it does then a reference to the sub is returned, if it does not then undef is returned.
VERSION( [NEED] )
VERSION returns the version number of the class (package). If the NEED argument is given then it will check that the current version (as defined by the $VERSION variable in the given package) not less than NEED; it will die if this is not the case. This method is called automatically by the VERSION form of use.
use Package 1.2 qw(some imported subs);
# implies:
Package->VERSION(1.2);
ISBN 9781906966027Perl Language Reference ManualSee the print edition