On Wed, 2003-09-10 at 10:07, Mark Stosberg wrote:
> On Wed, Sep 10, 2003 at 05:14:21AM -0400, Kevin C. Krinke wrote:
> > I have submitted a wish-list bug-report at rt.cpan.org for
> > ExtUtils::MakeMaker regarding a compliment option to the PM_FILTER
> > option for Perl Module files called PL_FILTER.
> > 
> > I would like to get everyone else's opinions on the matter as well.
> > 
> > If you don't have any idea as to what PL_FILTER would do, read the
> > following POD and think of a ".pl" script instead of a ".pm" (or even
> > ".PL") script.
> 
> How about a more general solution that allows to define a filter, as
> well which kinds of files it applies to? For example, covering ".pl" and
> ".PL" doesn't cover ".cgi", or binaries that get installed without an
> extension.

Well, I don't think .PL would need it considering that .PL's get run
during build and are intended to create _other_ files, in fact they can
create more than one file each (as the POD suggests).

I do agree that .cgi files could use something similar to this.

> In Data::FormValidator, I addressed something like this by using a
> regular expression as a hash key. I thinking of the following kind of
> syntax:
> 
> FILTER_MAP => {
>   qr/.pm$/                     => 'grep ...',  # like PM_FILTER
>   qr/.pl$/                     => 'grep ...',  # like PL_FILTER
>   qr/.cgi|my_binary/ => 'grep ...',  # ...very flexible
> },
> 
> In Data::FormValidator, there's also code to support this
> kind of syntax for older Perl's without "qr". It uses an RE to match
> an RE. It looks more hackish than just supporting 'qr', but it works
> reliably in that application.
> 
> I'd rather see something like this than a proliferation of "_FILTER"
> options tied to different extensions.

I do _not_ want to see any more _FILTER options myself. On the other
hand though PL_FILTER took me 20 minutes to figure out and implement.
Here's the drawback... this happens during the pm_to_blib() phase and at
this time, AFAIK pm_to_blib() does not touch any files that are not a
part of the 'PM' hashref. So anything put into EXE_FILES or any other
option would not get filtered and at this time I'm uncertain of what it
would take to implement a top level situation where there is the
FILTER_MAP and a FILTER_FILES compliment hashref.

The scope of a FILTER_MAP option seems to me that it belongs with
Module::Build (which is maturing nicely) and not ExtUtils::MakeMaker.
This hack is to extend EU::MM "just a little bit further" while I try to
wrap my neophyte mind around Module::Build as I'm assuming that
Module::Build has already solved this issue in some sane manner.

Just my $0.02 worth.
-- 
Kevin C. Krinke <[EMAIL PROTECTED]>
Open Door Software Inc.

Reply via email to