On Tue, 27 Apr 2010, Shlomi Fish wrote:
[code]
has '_get_paragraph_tag_name' => (is => 'ro', default => "para");
[/code]
And maybe specialise it further using «has '+_get_paragraph_tag_name'», but it
seems like it would be much more verbose.
I would do this ...
has _paragraph_name => ( is => 'ro', builder => '_build_paragraph_name' );
Then in the parent class:
sub _build_paragraph_name {
die 'This method must be overridden in the child'
}
As an aside, naming an attribute with a name starting with "get" is an
abomination. If you want PBP style accessors, use MooseX::FollowPBP.
Attribute names should be nouns, not verbs.
-dave
/*============================================================
http://VegGuide.org http://blog.urth.org
Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/