X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperltooc.pod;h=06f697cdef1f5fa2f63e1f5558afa92a7a5c6f2b;hb=03f3e794d79fbb3655a305de34b922dd4020d2ec;hp=78b6135717136e40ef1429c1a72bb7b3e645289c;hpb=5a2f86394dfa86bd3184e3ae8a7546e06047c35c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perltooc.pod b/pod/perltooc.pod index 78b6135..06f697c 100644 --- a/pod/perltooc.pod +++ b/pod/perltooc.pod @@ -922,7 +922,7 @@ all privacy in Perl, and it is a powerful form of privacy indeed. It is widely perceived, and indeed has often been written, that Perl provides no data hiding, that it affords the class designer no privacy -nor isolation, merely a rag-tag assortment of weak and unenforcible +nor isolation, merely a rag-tag assortment of weak and unenforceable social conventions instead. This perception is demonstrably false and easily disproven. In the next section, we show how to implement forms of privacy that are far stronger than those provided in nearly any @@ -1089,7 +1089,10 @@ for a significant performance improvement: if (my $coderef = $self->can($parent . "::CData1")) { $self->$coderef($newvalue); } - } + } + +If you override C in your own classes, be sure to return the +reference appropriately. =head2 Locking the Door and Throwing Away the Key @@ -1106,7 +1109,7 @@ itself access its own class attributes without the mediating intervention of properly designed accessor methods is probably not a good idea after all. Restricting access to class attributes from the class itself is usually -not enforcible even in strongly object-oriented languages. But in Perl, +not enforceable even in strongly object-oriented languages. But in Perl, you can. Here's one way: @@ -1298,7 +1301,7 @@ You can't use file-scoped lexicals in conjunction with the SelfLoader or the AutoLoader, because they alter the lexical scope in which the module's methods wind up getting compiled. -The usual mealy-mouthed package-mungeing doubtless applies to setting +The usual mealy-mouthed package-munging doubtless applies to setting up names of object attributes. For example, C<< $self->{ObData1} >> should probably be C<< $self->{ __PACKAGE__ . "_ObData1" } >>, but that would just confuse the examples.