From: Dave Rolsky Date: Tue, 3 Aug 2010 10:50:44 +0000 (+0200) Subject: Tweak augment example to use $self as needed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=62e6bee07fceae46a1910ff3c663e794a08733c8;p=gitmo%2Fmoose-presentations.git Tweak augment example to use $self as needed --- diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html index cc786a5..7759fd3 100644 --- a/moose-class/slides/index.html +++ b/moose-class/slides/index.html @@ -2417,19 +2417,21 @@ around run => sub {

Augment and Inner

-
package Document;
+  
package Document;
 
 sub xml { '<doc>' . inner() . '</doc>' }
 
 package Report;
 extends 'Document';
 augment xml =>
-    sub { title() . inner() . summary() };
+    sub { my $self = shift;
+          $self->title() . inner() . $self->summary() };
 
 package TPSReport;
 extends 'Report';
 augment xml =>
-    sub { tps_xml() . inner() };
+ sub { my $self = shift; + $self->tps_xml() . inner() };