Skip to Main Content
Perl Pocket Reference, 5th Edition
book

Perl Pocket Reference, 5th Edition

by Johan Vromans
July 2011
Intermediate to advanced content levelIntermediate to advanced
104 pages
2h 14m
English
O'Reilly Media, Inc.
Content preview from Perl Pocket Reference, 5th Edition

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Testing: A Developer's Notebook

Perl Testing: A Developer's Notebook

Ian Langworth, Chromatic
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 9781449311186Errata Page