MIME::Expander::Guess - An interface of classes determine mime type.
package MyGuessRoutine; use base 'MIME::Expander::Guess'; sub type { my $class = shift; my $ref_contents = shift; my $info = shift || { filename => 'name.suffix' }; # ... return lc('type/sub-type'); }
It have only class method 'type' which guess type from contents.
You have to implement a class method 'type', determine and return the mime type as lower case string.
If it could not determine, return the undef.
MIME::Expander::Guess::FileName
MIME::Expander::Guess::MMagic
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.