Re: How to make this nicer

2009-06-04 Thread Yuri Shtil
Hans Dieter Pearcey wrote: On Sun, May 03, 2009 at 11:00:30AM -0700, Yuri Shtil wrote: I have a bunch of subclasses of X like this all having similar code. For example in the class X::Procedure I would have the same code with procedure replaced by step. use

Re: How to make this nicer

2009-06-04 Thread Yuri Shtil
Chris Prather wrote: On Thu, Jun 4, 2009 at 10:34 PM, Yuri Shtilyu...@juniper.net wrote: How do I access the container object (where the with is) from the role method? $self ? -Chris The first thing on the arg list to self is the parameter, no self here. The named parameter

How to make this nicer

2009-05-03 Thread Yuri Shtil
Hi All, Here is a piece of code I have: - package X::Project; use Moose; extends 'X'; use MooseX::AttributeHelpers; use Moose::Util::TypeConstraints; use namespace::clean; use MooseX::Method qw/:compiled/; method procedures = sub { CODE }; subtype 'Procedure' = as Any = where { my $type

Re: How to make this nicer

2009-05-03 Thread Hans Dieter Pearcey
On Sun, May 03, 2009 at 11:00:30AM -0700, Yuri Shtil wrote: I have a bunch of subclasses of X like this all having similar code. For example in the class X::Procedure I would have the same code with procedure replaced by step. use MooseX::Role::Parameterized hdp.