markov2 / perl5-MIME-Types

Definition of MIME types
http://perl.overmeer.net/CPAN
4 stars 1 forks source link

types database can not be fatpacked #4

Closed ufobat closed 6 years ago

ufobat commented 6 years ago

Hi Mark,

the types database will not be added, when you fatpack this module. I thought that converting the *.db in a *.pm file with a heredoc might fix that.

Thats what I do as a work around

package My::Namespace::MIME::Types::Database;
use strict;
use warnings;

my $data = <<'EOF';
2118:EXTENSIONS
#;application/x-mathcad
%;application/x-trash
....
EOF

sub get_data_ref { return \$data }
my $mt = MIME::Types->new(db_file => get_data_ref());
markov2 commented 6 years ago

MIME::Types before release 2.* did use such a section. However, that did not work well in threading and forking environments. So, from 2.00 a separate file is used.

The db file is part of the distribution of MIME::Types. If fatpack is unable to include all files of distributions, i would advise you to complain to the author of fatpack.

ufobat commented 6 years ago

As far as I understood how fatpack works, I think this can not be addressed that easily. Fatpack hooks into the way how perl requires other modules.