Re: PAR vs MIME::Types

[email protected] (Ron W)
Newsgroups perl.par
Message-ID <CAHWyCX6O0yWLPHZGKbD461sL-mNhgOKyKWXkN1XG4m-Nvc3AbA@mail.gmail.com>
On Sun, Jun 14, 2015 at 8:32 AM, Roderich Schupp <[email protected]>
wrote:

> On Thu, Jun 11, 2015 at 8:09 PM, Philip Gwyn <[email protected]> wrote:
> > To me, all libraries should allow the caller to specify where to find
> data
> > files.
>
> That's a nightmare for admins and packagers...
>

Looking at MIME::Types, I see the following in _read_db

    my $db              = $ENV{PERL_MIME_TYPE_DB}
      || $args->{db_file}
      || File::Spec->catfile(dirname(__FILE__), 'types.db');

So, MIME::Types already provides a way for the caller to specify where to
find data.

If there is a standard location in the package, relative to the packaged
application, for data files, then I would say there's no need to make a
change to PAR::Packer

If I were going to make a change to PAR::Packer, I would be inclined to
provide the packaged application with $ENV{PP_PERL_MIME_TYPE_DB} set to the
packaged location of types.db so that the application could then decide
where to tell the module to look for the file.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.