Object::Meta::Plugin::ExportList - an implementation of a very simple, string only export list.
# the proper way my $plugin = GoodPlugin->new(); $host->plug($plugin); package GoodPlugin; # ... sub exports { qw/some methods/; } sub init { my $self = shift; return Object::Meta::Plugin::ExportList->new($self}; } # or if you prefer.... *drum roll* # the naughty way my $plugin = BadPlugin->new(); # doesn't need to be a plugin per se, since # it's not verified by plug(). All it needs # is to have a working can(). the export # list is responsible for the rest. # in short, this way init() needn't be defined. my $export = Object::Meta::Plugin::ExportList->new($plugin, qw/foo bar/); $host->register($export);
An export list is an object a plugin hands over to a host, stating what it is going to give it. This is a very basic implementation, providing only the bare minimum methods needed to register a plugin. Unregistering one requires even less.
Creates a new export list object. When passed only a plugin, and no method names as additional arguments,
Returns the reference to the plugin object it represents.
Returns truth if the method stated is exported.
Returns a list of exported method names.
Performs an OR with the methods of the argued export list.
Performs an AND of the COMPLEMENT of the argued export list.
Relies on the plugin implementation to provide a non-mandatory extension - the exports method. This method is available in all the Object::Meta::Plugin::Useful variants, and since Object::Meta::Plugin is not usable on it's own this is probably ok.
exports
Not that I know of, for the while being at least.
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::Host
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.