On Tue, 27 Apr 2010, Hans Dieter Pearcey wrote:

On Tue, 27 Apr 2010 10:54:06 -0500 (CDT), Dave Rolsky <auta...@urth.org> wrote:
  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'
  }

Alternately, turn your parent class into a role that contains
_gen_paragraph_tag and requires _build_paragraph_name.  This has the advantage
of failing immediately when composed into a class without the required method,
instead of dying at runtime when it's called.

I agree, that's much better.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

Reply via email to