On Wed, Jul 14, 2010 at 07:25:04PM -0700, Kate Yoak wrote: > Hi everyone, > > Here is a stumper. > > I have some non-moose code, which is intended to be subclassed - it's just a > framework. > I'd like to create a wrapper that Moosefies it. And while I am at it, I'd > like to make the framework a Role (since that's what frameworks generally > are). > > But any which way I spin it, it doesn't work. > > use Moose::NonMoose; > use Moose::Role; > > complains that NonMoose doesn't do roles. > > I tried creating a bridging package which does the NonMoose part, then > > package Framework; > > use Moose::Role; > extends 'Old::Moosefied::Framework'; > > complains because roles doesn't support extends. > > Is there another approach? > > Kate
Nope... you can't magically turn a class (even a non-Moose class) into a role... roles just don't work like that. Sticking with extends is really your only option for dealing with non-Moose code. -doy
