MIME::Expander::Guess::MMagic - An implementation for guessing mime type
use MIME::Expander; use IO::All; my $filename = $ARGV[0]; my $contents < io $filename; my $me = MIME::Expander->new({ guess_type => ['MMagic','FileName'], }); my $type = $me->guess_type_by_contents( \$contents, {filename => $filename});
Guess the mime type from contents using File::MMagic.
MIME::Expander::Guess
File::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.