http://www.perlmonks.org?node_id=413204

dragonchild has asked for the wisdom of the Perl Monks concerning the following question:

I want to add Module::Build support to my CPAN distros - I want to do what all the cool kids are doing.

Except, I use PM_FILTER. *hangs head in shame* I know Schwern has unofficially discouraged it, but I (think I) need it. And, nowhere in the POD for Module::Build is there anything that says how to convert PM_FILTER usage.

So, my question goes kinda like this:

  1. Do I really need PM_FILTER?
  2. If I do, how do I mimic it under Module::Build?

For reference, I use PM_FILTER because PDF::Template supports Unicode for all versions of Perl. Pre-5.8, I use Unicode::String for all my string handling. So, in two .pm files, I have code that looks something like

UNI_YES $x -= $str->length * $font_size; UNI_NO $x -= length($str) * $font_size;
My PM_FILTER code looks like
my $pm_filter = $use_unicode ? q{perl -pi -e "s!UNI_YES ! !g;s!UNI_NO !\\#!g"} : q{perl -pi -e "s!UNI_NO ! !g;s!UNI_YES !\\#!g"};

Which works, AFAICT, on every system that PDF::Template has been installed on. (Which, if I'm honest, has only been Unix, Linux, and Cygwin.)

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.