O'Reilly logo

Perl Pocket Reference, 5th Edition by Johan Vromans

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Special Classes

The special class UNIVERSAL contains methods that are automatically inherited by all other classes:

can method

Returns a reference to the method if its invocant has it, undef otherwise.

DOES role

Checks if the object or class performs the given role.

isa class

Returns true if its invocant is class, or any class inheriting from class.

VERSION [ need ]

Returns the version of its invocant. Checks the version if need is supplied.

These methods can be used as normal functions as well, e.g., UNIVERSAL::isa($c,Math::Complex::).

The pseudopackage CORE provides access to all Perl built-in functions, even when they have been overridden.

The pseudopackage SUPER provides access to base class methods without having to specify which class defined that method. This is meaningful only when used inside a method.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required