Chapter 14. Bless Those Things! (Object-Oriented Perl)

14.1 The OOP Paradigm

By the end of this chapter, you will be able to read and write the following code:

use Cirle::Area;use base qw(Shape);$c1 = Circle::Area->new();$c2 = Circle::Area->new();$c1->setRadius(5);$c1->setArea();$c2->setRadius(12);$c2->setArea();print $c1->getArea();

14.1.1 What Are Objects?

Objects are things we deal with every day. Most programming languages, such as Java and C++, also deal with objects, and those languages are called OOP (Object-Oriented Programming) languages. OOP is a way of organizing a program to solve problems in terms of real-world objects. Early Perl (Perl 4) did not support OOP, but with the advent of Perl 5, the big addition was the ability to ...

Get Perl by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.