05 Aug 2015 23:34:16 UTC
- Distribution: Module-Pluggable
- Module version: 5.2
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (12)
- Testers (7197 / 149 / 3)
- KwaliteeBus factor: 0
- 85.55% Coverage
- License: perl_5
- Perl: v5.5.30
- Activity24 month
- Download (26.29KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Module::Pluggable::Object - automatically give your module the ability to have plugins
Simple use Module::Pluggable -
package MyClass; use Module::Pluggable::Object; my $finder = Module::Pluggable::Object->new(%opts); print "My plugins are: ".join(", ", $finder->plugins)."\n";
Provides a simple but, hopefully, extensible way of having 'plugins' for your module. Obviously this isn't going to be the be all and end all of solutions but it works for me.
Essentially all it does is export a method into your namespace that looks through a search path for .pm files and turn those into class names.
Optionally it instantiates those classes for you.
This object is wrapped by
Module::Pluggable. If you want to do something odd or add non-general special features you're probably best to wrap this and produce your own subclass.
Simon Wistow <email@example.com>
Copyright, 2006 Simon Wistow
Distributed under the same terms as Perl itself.
Module Install Instructions
To install Module::Pluggable, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Module::Pluggable
For more information on module installation, please visit the detailed CPAN module installation guide.