On 10/04/2013 08:07 PM, bulk 88 wrote:
So SUPER class works. My code has to get the original makefile chunk
MM would have put there and then manipulate it. But I tried to not be
dependent on MM's design so I didn't want to call an absolute named
method/sub so I switch packages in the sub and did a SUPER call. The
MY package doesn't inherit anything and I didn't think about adding
anything to it since MM cleans out the MY package after each
WriteMakefile call which sounds unfriendly but it does that.
but... this is done differently in ExtUtils::MakeMaker docs:
http://search.cpan.org/~bingos/ExtUtils-MakeMaker-6.78/lib/ExtUtils/MakeMaker.pm#Overriding_MakeMaker_Methods
in particular:
package MY; # so that "SUPER" works right
sub c_o {
my $inherited = shift->SUPER::c_o(@_);
# ...
}
I checked as back as CPAN goes (ExtUtils::MakeMaker 6.54 from 2009) and
this was still the documented way of doing it, so it doesn't seem to be
a new thing (and hopefully works on 5.8 too).
cheers,
Aldo