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.

Great idea!  I am surprised somebody has not done this yet.

But-

> <...>
> PM_FILTER
>   A filter program, in the traditional Unix sense (input from stdin,
>   output to stdout) that is passed on each .pm file during the build
>   (in the pm_to_blib() phase).  It is empty by default, meaning no fil-
>   tering is done.
>  
>   Great care is necessary when defining the command if quoting needs to
>   be done.  For instance, you would need to say:
>  
>     {'PM_FILTER' => 'grep -v \\"^\\#\\"'}
>  
>   to remove all the leading coments on the fly during the build.  The
>   extra \\ are necessary, unfortunately, because this variable is
>   interpolated within the context of a Perl program built on the com-
>   mand line, and double quotes are what is used with the -e switch to
>   build that command line.  The # is escaped for the Makefile, since
>   what is going to be generated will then be:
>  
>     PM_FILTER = grep -v \"^\#\"
>  
>   Without the \\ before the #, we'd have the start of a Makefile com-
>   ment, and the macro would be incorrectly defined.
> </...>
> 
> I've attached a patch for ExtUtils::MakeMaker version 6.16 that
> implements this feature (yes the patch has been submitted to
> rt.cpan.org, but that one was flawed and I've since corrected the issue,
> thus the -2 in the patch filename, and yes I have submitted the updated
> patch to [EMAIL PROTECTED] but have yet to receive a response from
> anyone).

...I do not see a good reason that these filters should spawn a separate process
to execute a regex for every filter for every file.

Why not  implement "the traditional unix  sense" filter in perl?   Or change the
module to do it in "the traditional perl sense".

Or provide the option to do it with either method.

Or, even better, implement it in perl  then the programmer can create all of the
shell-filter processes that they want, e.g., with backticks.

What about code-refs, callbacks?  I would rather use callbacks than an automatic
separate process.

...however you think it should be done.  But the _mandatory_ pipe is ridiculous
when we are using perl.  I use perl to eliminate pipes, not proliferate them.

-- 

Robert Lehr
(let ((func (lambda (u d) (concat u "@" d))))
  (funcall func "bozzio" "the-lehrs.com"))

Reply via email to