From: Dave Rolsky Date: Thu, 7 Jul 2011 18:51:28 +0000 (-0500) Subject: Small revisions to the text to increase clarity, suggested by Philip Monsen X-Git-Tag: v5.15.3~195 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/d49ecf98d29a2bfc3de8eca3c8ecaf2e5c7b13b7 Small revisions to the text to increase clarity, suggested by Philip Monsen --- diff --git a/pod/perlootut.pod b/pod/perlootut.pod index 062706d..837b7b4 100644 --- a/pod/perlootut.pod +++ b/pod/perlootut.pod @@ -56,10 +56,10 @@ subroutines which operate on that data. An object's data is called B, and its subroutines are called B. An object can be thought of as a noun (a person, a web service, a computer). -An object represents a single discrete thing. For example, an -object might represent a person. The attributes for a person object -might include name, birth date, and country of residence. If we created -an object to represent Larry Wall, Perl's creator, that object's name +An object represents a single discrete thing. For example, an object +might represent a person. The attributes for a person object might +include name, birth date, and country of residence. If we created an +object to represent Larry Wall, Perl's creator, that object's name would be "Larry Wall", born on "September 27, 1954", and living in "USA". @@ -216,8 +216,8 @@ B is a way to specialize an existing class. It allows one class to reuse the methods and attributes of another class. We often refer to inheritance relationships as B or -C relationships. Sometimes this is called an -B relationship. +C relationships. Sometimes we say that the child +has an B relationship with its parent class. Inheritance is best used to create a specialized version of a class. For example, we could create an C class which B @@ -251,7 +251,7 @@ Inheritance allows two classes to share code. By default, every method in the parent class is also available in the child. The child can explicitly B a parent's method to provide its own implementation. For example, if we have an C object, it has -the C method from person: +the C method from C: my $larry = Employee->new( name => 'Larry Wall', @@ -342,9 +342,9 @@ relationship. Earlier, we mentioned that the C class's C accessor could return a L object. This is a perfect example of -composition. We could go even further, and make objects for name and -country as well. The C class would then be B of -several other objects. +composition. We could go even further, and make the C and +C accessors return objects as well. The C class would +then be B of several other objects. =head2 Roles