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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset