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

Object-Oriented Programming

An object is a referent that knows which class it belongs to.

A class is a package that provides methods. If a package fails to provide a method, the base classes as listed in @ISA are searched, depth first.

A method is a subroutine that expects an invocant (an object reference or, for static methods, a package name) as the first argument.

bless ref [ , classname ]

Turns the referent ref into an object in classname (default is the current package). Returns the reference.

invocant->method [ ( parameters ) ]

Calls the named method.

method invocant [ parameters ]

Provides an alternative way of calling a method, using the sometimes ambiguous indirect object syntax.

See also ref (page 63), and the next section.

perlobj, perlboot, perltoot, perltooc.

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