X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperltoot.pod;h=aae3b7393df96e8195f4fc57851807013930800b;hb=7cfe7857715f78206e6d7d6f7fd52983de4dec44;hp=3fdedc2513796485c22a18abb254891a389fa777;hpb=5f05dabc4054964aa3b10f44f8468547f051cdf8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perltoot.pod b/pod/perltoot.pod index 3fdedc2..aae3b73 100644 --- a/pod/perltoot.pod +++ b/pod/perltoot.pod @@ -448,7 +448,7 @@ of magicalness to a C programmer. It's really just a mnemonic device to remind ourselves that this field is special and not to be used as a public data member in the same way that NAME, AGE, and PEERS are. (Because we've been developing this code under the strict pragma, prior -to 5.004 we'll have to quote the field name.) +to perl version 5.004 we'll have to quote the field name.) sub new { my $proto = shift; @@ -928,7 +928,7 @@ superclass's name. This in particular is bad if you change which classes you inherit from, or add others. Fortunately, the pseudoclass SUPER comes to the rescue here. - $class->SUPER::debug($Debugging); + $self->SUPER::debug($Debugging); This way it starts looking in my class's @ISA. This only makes sense from I a method call, though. Don't try to access anything @@ -1087,10 +1087,10 @@ base class? That way you could give every object common methods without having to go and add it to each and every @ISA. Well, it turns out that you can. You don't see it, but Perl tacitly and irrevocably assumes that there's an extra element at the end of @ISA: the class UNIVERSAL. -In 5.003, there were no predefined methods there, but you could put +In version 5.003, there were no predefined methods there, but you could put whatever you felt like into it. -However, as of 5.004 (or some subversive releases, like 5.003_08), +However, as of version 5.004 (or some subversive releases, like 5.003_08), UNIVERSAL has some methods in it already. These are built-in to your Perl binary, so they don't take any extra time to load. Predefined methods include isa(), can(), and VERSION(). isa() tells you whether an object or @@ -1196,7 +1196,7 @@ replace the variables above like $AGE with literal numbers, like 1. A bigger difference between the two approaches can be found in memory use. A hash representation takes up more memory than an array representation because you have to allocation memory for the keys as well as the values. -However, it really isn't that bad, especially since as of 5.004, +However, it really isn't that bad, especially since as of version 5.004, memory is only allocated once for a given hash key, no matter how many hashes have that key. It's expected that sometime in the future, even these differences will fade into obscurity as more efficient underlying @@ -1271,7 +1271,7 @@ Although this is the same function each time, it contains a different version of $self. When a method like C<$him-Ename("Jason")> is called, its implicit -zeroth argument is as the invoking object just as it is with all method +zeroth argument is the invoking object just as it is with all method calls. But in this case, it's our code reference (something like a function pointer in C++, but with deep binding of lexical variables). There's not a lot to be done with a code reference beyond calling it, so