X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlboot.pod;h=6e3f5ac8ab8a6775c55e666852df689e79869b31;hb=0c42fe95656e99f238a0bcf90ab2476c175615b7;hp=bd39c44ea7a7706c4f2535e8f83aeb00afcab33f;hpb=dd69841bebe1fc7f7a6b248576221520a0418d52;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlboot.pod b/pod/perlboot.pod index bd39c44..6e3f5ac 100644 --- a/pod/perlboot.pod +++ b/pod/perlboot.pod @@ -26,7 +26,7 @@ Let's let the animals talk for a moment: print "a Horse goes neigh!\n"; } sub Sheep::speak { - print "a Sheep goes baaaah!\n" + print "a Sheep goes baaaah!\n"; } Cow::speak; @@ -106,7 +106,7 @@ example: print "a Horse goes neigh!\n"; } sub Sheep::speak { - print "a Sheep goes baaaah!\n" + print "a Sheep goes baaaah!\n"; } @pasture = qw(Cow Cow Horse Sheep Sheep); @@ -172,7 +172,7 @@ This method provides the constant text for the sound itself. sub sound { "moooo" } sub speak { my $class = shift; - print "a $class goes ", $class->sound, "!\n" + print "a $class goes ", $class->sound, "!\n"; } } @@ -184,7 +184,7 @@ returns C. But how different would this be for the C? sub sound { "neigh" } sub speak { my $class = shift; - print "a $class goes ", $class->sound, "!\n" + print "a $class goes ", $class->sound, "!\n"; } } @@ -200,7 +200,7 @@ definition for C: { package Animal; sub speak { my $class = shift; - print "a $class goes ", $class->sound, "!\n" + print "a $class goes ", $class->sound, "!\n"; } } @@ -336,7 +336,7 @@ subroutine. Also note that the C classname is now hardwired into the subroutine selection. This is a mess if someone maintains the code, -changing C<@ISA> for and didn't notice C there in +changing C<@ISA> for C and didn't notice C there in C. So, this is probably not the right way to go. =head2 Starting the search from a different place @@ -423,7 +423,7 @@ and the C class: { package Animal; sub speak { my $class = shift; - print "a $class goes ", $class->sound, "!\n" + print "a $class goes ", $class->sound, "!\n"; } } { package Horse; @@ -574,7 +574,7 @@ C, so let's put it there: { package Animal; sub speak { my $class = shift; - print "a $class goes ", $class->sound, "!\n" + print "a $class goes ", $class->sound, "!\n"; } sub name { my $self = shift; @@ -610,7 +610,7 @@ shows up as we saw it just now. All we need is for a method to detect if it is being called on a class or called on an instance. The most straightforward way is with the C operator. This returns a string (the classname) when used on a -blessed reference, and C when used on a string (like a +blessed reference, and an empty string when used on a string (like a classname). Let's modify the C method first to notice the change: sub name {