in reply to Is dynamic loading of pm's a bad thing?
With a little help from you friendly neighbour CPAN modules this is a pretty standard plugin loader
See. Module::Locate and Carp for more info.use Carp 'croak'; use Module::Locate 'locate'; sub get_a_parser { my $mod = "EP::Parser::$_[0]"; require locate $mod or croak "Couldn't locate module '$mod'"; return $mod->new( @_[ 1 .. $#_ ] ); }
HTH
_________
broquaint
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is dynamic loading of pm's a bad thing?
by CassJ (Sexton) on Jun 28, 2004 at 17:00 UTC | |
Re^2: Is dynamic loading of pm's a bad thing?
by CassJ (Sexton) on Jun 28, 2004 at 14:57 UTC | |
by broquaint (Abbot) on Jun 29, 2004 at 03:09 UTC |
In Section
Seekers of Perl Wisdom