From: Michael Witten Date: Tue, 7 Apr 2009 19:59:22 +0000 (-0500) Subject: Docs: Make the "use base" purpose more obvious X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2ee409f9fc5c2201b0d49c1f13f3c2ae8804305b;p=p5sagit%2Fp5-mst-13.2.git Docs: Make the "use base" purpose more obvious Signed-off-by: Michael Witten --- diff --git a/pod/perlboot.pod b/pod/perlboot.pod index 64ad4e7..afe9837 100644 --- a/pod/perlboot.pod +++ b/pod/perlboot.pod @@ -264,20 +264,14 @@ Or allow it as an implicitly named package variable: use vars qw(@ISA); @ISA = qw(Animal); -If you're bringing in the class from outside, via an object-oriented -module, you change: - - package Cow; - use Animal; - use vars qw(@ISA); - @ISA = qw(Animal); - -into just: +If the C class comes from another (object-oriented) module, then +just employ C to specify that C should serve as the basis +for the C class: package Cow; use base qw(Animal); -And that's pretty darn compact. +Now that's pretty darn simple! =head2 Overriding the methods