Re: request for comments on code for ExtUtils::MY overrides

David Christensen <[email protected]> Mon, 29 Nov 2010 15:25:20 -0800
Newsgroups gmane.comp.lang.perl.modules.extutils-makemaker.devel
Message-ID <[email protected]>
makemaker:

I've uploaded the tarballs here:

     http://holgerdanske.com/node/485


This is what I'm thinking for the next iteration of 
Dpchrist::ExtUtils::MakeMaker:

=head1 SYNOPSIS

     # Makefile.PL
     package Dpchrist::ExtUtils::MakeMaker;      # to find symbols
     use strict;
     use warnings;
     eval {
         require Dpchrist::ExtUtils::MakeMaker;
         import Dpchrist::ExtUtils::MakeMaker (
             postamble => sub {
                 my $prev_text = shift;  # previous override, if any
                 return join("\n",
                     $prev_text,
                     mcpani($ENV{CPAN_AUTHORID}),
                     pod2html('lib/Dpchrist/ExtUtils/MakeMaker.pm'),
                     readme('lib/Dpchrist/ExtUtils/MakeMaker.pm'),
                     release($ENV{RELEASE_ROOT}),
                 );
             },
         );
     };
     warn $@ if $@;


=head3 import

     # Makefile.PL
     package Dpchrist::ExtUtils::MakeMaker;      # to find symbols
     use strict;
     use warnings;
     eval {
         require Dpchrist::ExtUtils::MakeMaker;
         import Dpchrist::ExtUtils::MakeMaker (
             SECTION => CODEREF,
             SECTION => CODEREF,
             SECTION => CODEREF,
         );
     };
     warn $@ if $@;

Daisy-chains subroutine CODEREF
into the Makefile override for given SECTION.
Any previous override function (e.g. &MY::SECTION)
will be called before CODEREF
and it's output passed as the first argument to CODEREF.
CODEREF should return a scalar string containing
the net text to be placed in the appropriate Makefile section.


Any comments?


David