Upgrade to Math::BigInt 1.40.
[p5sagit/p5-mst-13.2.git] / pod / perltootc.pod
index 85ae6fb..d2d881c 100644 (file)
@@ -12,7 +12,7 @@ the class itself.
 
 Here are a few examples where class attributes might come in handy:
 
-=over
+=over 4
 
 =item *
 
@@ -74,6 +74,15 @@ you can elect to permit access to them from anywhere in the entire file
 scope, or you can limit direct data access exclusively to the methods
 implementing those attributes.
 
+=head1 Class Data in a Can
+
+One of the easiest ways to solve a hard problem is to let someone else
+do it for you!  In this case, Class::Data::Inheritable (available on a
+CPAN near you) offers a canned solution to the class data problem
+using closures.  So before you wade into this document, consider
+having a look at that module.
+
+
 =head1 Class Data as Package Variables
 
 Because a class in Perl is really just a package, using package variables
@@ -184,7 +193,7 @@ to which beginning Perl programmers attempt to put symbolic references,
 we have much better approaches, like nested hashes or hashes of arrays.
 But there's nothing wrong with using symbolic references to manipulate
 something that is meaningful only from the perspective of the package
-symbol symbol table, like method names or package variables.  In other
+symbol table, like method names or package variables.  In other
 words, when you want to refer to the symbol table, use symbol references.
 
 Clustering all the class attributes in one place has several advantages.
@@ -653,8 +662,8 @@ settings can then be used in constructors for initialization of a
 particular object.  The class's eponymous hash can also be used to
 implement I<translucent attributes>.  A translucent attribute is one
 that has a class-wide default.  Each object can set its own value for the
-attribute, in which case C<$object-E<gt>attribute()> returns that value.
-But if no value has been set, then C<$object-E<gt>attribute()> returns
+attribute, in which case C<< $object->attribute() >> returns that value.
+But if no value has been set, then C<< $object->attribute() >> returns
 the class-wide default.
 
 We'll apply something of a copy-on-write approach to these translucent
@@ -1294,15 +1303,16 @@ 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
-up names of object attributes.  For example, C<$self-E<gt>{ObData1}>
-should probably be C<$self-E<gt>{ __PACKAGE__ . "_ObData1" }>, but that
+up names of object attributes.  For example, C<< $self->{ObData1} >>
+should probably be C<< $self->{ __PACKAGE__ . "_ObData1" } >>, but that
 would just confuse the examples.
 
 =head1 SEE ALSO
 
 L<perltoot>, L<perlobj>, L<perlmod>, and L<perlbot>.
 
-The Tie::SecureHash module from CPAN is worth checking out.
+The Tie::SecureHash and Class::Data::Inheritable modules from CPAN are
+worth checking out.
 
 =head1 AUTHOR AND COPYRIGHT
 
@@ -1334,4 +1344,4 @@ object-oriented languages enforce.
 
 =head1 HISTORY
 
-Last edit: Fri May 21 15:47:56 MDT 1999
+Last edit: Sun Feb  4 20:50:28 EST 2001