in reply to Re: Plugin-type architecture
in thread Plugin-type architecture
Then in YourModule have an import like this:use YourModule qw( List Of Plugins );
This assumes that your plugins are really called YourModule::Plugin::Name and that they don't go deeper (so YourModule::Plugin::TopLevel::Name won't work). But you could change the way the name is formed to take care of that.use File::Spec; sub import { my $class = shift; foreach my $plugin ( @_ ) { my $fullname = File::Spec::catfile( $class, 'Plugin', "$plugin.pm" ); require $fullname; } }
Phil
|
|---|