home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Webmaster in a Nutshell

Previous Chapter 15
Perl Quick Reference
Next
 

15.7 Object-Oriented Programming

Perl rules of object-oriented programming:

  • An object is simply a reference that happens to know which class it belongs to. Objects are blessed, references are not.

  • A class is simply a package that happens to provide methods to deal with object references. If a package fails to provide a method, the base classes as listed in @ISA are searched.

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

Methods can be applied with:

method objref parameters        or
objref->method parameters


Previous Home Next
Subroutines, Packages, and Modules Book Index Arithmetic Functions

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell