MIME::Expander::Plugin - Abstract class for plugin of MIME::Expander
# An implement class package MIME::Expander::Plugin::MyExpander; use parent qw(MIME::Expander::Plugin); # This plugin has to be implemented class data 'ACCEPT_TYPES' # to negotiate for acceptable type __PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( type/sub-type )]); # And expand() for determine type sub expand { my $self = shift; my $part = shift; my $callback = shift; my $count = 0; my $contents = $part->body; while( my $media = your_expand_function( $contents ) ){ my $data = $media->{data}; my $filename = $media->{name}; $callback->( \ $contents, { filename => $filename, # optional, sometimes it is undef }); ++$count; } # number of expanded contents return $count; }
MIME::Expander::Plugin is an abstract class for plugin of MIME::Expander.
Each plugins extended this class have to expand the contents of ACCEPT_TYPES and passes each to the callback.
MIME::Expander
Class::Data::Inheritable
To install MIME::Expander, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MIME::Expander
CPAN shell
perl -MCPAN -e shell install MIME::Expander
For more information on module installation, please visit the detailed CPAN module installation guide.