in reply to Dynamic inheritance with Moose?
Module::Pluggable::Object and Class:MOP should be a good start. There's an example of doing this in the new Catalyst book. Something along the lines of this (not-tested code) should work
Depending on how your search_path is, you may need to muck with the class name before calling new (like strip off the leading path).my $mp = Module::Pluggable::Object->new( search_path => [ "/path/to/classes" ] ); my @classes = $mp->plugins; # choose which class from classes Class::MOP::load_class( $class ); return $class->new;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamic inheritance with Moose?
by Shinama (Acolyte) on Aug 07, 2009 at 07:25 UTC |