From: Anders Nor Berle Date: Thu, 22 Mar 2007 19:00:17 +0000 (+0000) Subject: Explain attributes and subclassing X-Git-Tag: 0_19~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43b50af34c88c00f35c97282cfcb8f5cd5bd81c4;p=gitmo%2FMoose.git Explain attributes and subclassing --- diff --git a/lib/Moose/Cookbook/WTF.pod b/lib/Moose/Cookbook/WTF.pod index 0bbc6c3..b0dfa8a 100644 --- a/lib/Moose/Cookbook/WTF.pod +++ b/lib/Moose/Cookbook/WTF.pod @@ -109,10 +109,30 @@ Here is some sample code: return reverse @rv; }; +=head2 Moose and Attributes + +=head3 Why doesn't 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 +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/ } + +=head2 Moose and Other Modules + +=head3 Why can't I get Catalyst and Moose to work together? + +See L. + =head1 AUTHOR Stevan Little Estevan@iinteractive.comE +Anders Nor Berle Edebolaz@gmail.comE + =head1 COPYRIGHT AND LICENSE Copyright 2006, 2007 by Infinity Interactive, Inc. @@ -122,4 +142,4 @@ L This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -=cut \ No newline at end of file +=cut