Object::Meta::Plugin::Useful::Generic - a generic useful plugin base class.
package MyFoo; use bas "Object::Meta::Plugin::Useful::Generic"; sub new { my $pkg = shift; my $self = $pkg->SUPER::new(@_); $self->export(qw/foo bar/); } sub foo { # ... } sub bar { # ... }
This provides a very simple base class for a plugin. It uses the method export to explicitly mark a method name for exporting. When Object::Meta::Plugin::Useful's init hits
export
init
This method takes a list of method names, and makes sure they are all implemented ($self-can($method)>) and so forth. It then makes notes of what remains, and will return these values when the exports method is called by the standard export list implementation.
$self-
Will emit warnings if lexical warnings are asked for. It will bark when $self-can($method)> is not happy. You can suppress it with
no warnings 'MyFoo';
Or
no warnings 'Object::Meta::Plugin::Useful::Generic';
Depending on what level you'd like the warnings to be suppressed.
Namespace is not well defined within the hash, nor is it guaranteed that it will never be extended.
Copyright 2003 Yuval Kogman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Yuval Kogman <nothingmuch@woobling.org>
Object::Meta::Plugin, Object::Meta::Plugin::Useful, Object::Meta::Plugin::Useful::Meta, Object::Meta::Plugin::Useful::Greedy.
To install Object::Meta::Plugin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::Meta::Plugin
CPAN shell
perl -MCPAN -e shell install Object::Meta::Plugin
For more information on module installation, please visit the detailed CPAN module installation guide.