- 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 perlobj: Perl objects

First you need to understand what references are in Perl. See 15 for that. Second, if you still find the following reference work too complicated, a tutorial on object-oriented programming in Perl can be found in "Tom's object-oriented tutorial for perl" (perltoot) in Perl Tutorials and "Tom's OO Tutorial for Class Data in Perl" (perltooc) in Perl Tutorials.

If you're still with us, then here are three very simple definitions that you should find reassuring.

  1. An object is simply a reference that happens to know which class it belongs to.
  2. A class is simply a package that happens to provide methods to deal with object references.
  3. A method is simply a subroutine that expects an object reference (or a package name, for class methods) as the first argument.

We'll cover these points now in more depth.

ISBN 9781906966027Perl Language Reference ManualSee the print edition