Indirect Objects
Learn when to avoid using indirect objects and why.
We'll cover the following...
Perl isn't a pure object-oriented language. It has no operator new
; a constructor is anything that returns an object. By convention, constructors are class methods named new()
, but we can name these methods anything we want or even use functions. Several old Perl OO tutorials promote the use of C++ and Java-style constructor calls:
Access this course and 1400+ top-rated courses and projects.