From: Dave Rolsky Date: Mon, 9 Feb 2009 22:18:13 +0000 (+0000) Subject: Clarify that this wtf is about subroutine attributes X-Git-Tag: 0.69~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01cee73400920d7824b9016d9307139316bd1a2d;p=gitmo%2FMoose.git Clarify that this wtf is about subroutine attributes --- diff --git a/lib/Moose/Cookbook/WTF.pod b/lib/Moose/Cookbook/WTF.pod index 9210857..4b07bcd 100644 --- a/lib/Moose/Cookbook/WTF.pod +++ b/lib/Moose/Cookbook/WTF.pod @@ -109,9 +109,9 @@ Here is some sample code: return reverse @rv; }; -=head2 Moose and Attributes +=head2 Moose and Subroutine Attributes -=head3 Why don't attributes I inherited from a superclass work? +=head3 Why don't subroutine attributes I inherited from a superclass work? Currently when you subclass a module, this is done at runtime with the C keyword but attributes are checked at compile time @@ -119,7 +119,12 @@ by Perl. To make attributes work, you must place C in a C block so that the attribute handlers will be available at compile time like this: - BEGIN { extends qw/Foo/ } + BEGIN { extends qw/Foo/ } + +Note that we're talking about Perl's subroutine attributes here, not +Moose attributes: + + sub foo : Bar(27) { ... } =head2 Moose and Other Modules