in reply to Re: How to avoid having to remove PERL_DL_NONLAZY=1 from Makefile?
in thread How to avoid having to remove PERL_DL_NONLAZY=1 from Makefile?

So how do I override those methods? I tried calling $self->SUPER::test_via_harness( @_ ) and the object I've received isn't ISA ExtUtils anything.

Writing Makefile for Data::Postponed Can't locate object method "test_via_harness" via package "main" at Ma +kefile.PL line 25. # Looks like your test died before it could output anything. sub MY::test_via_harness { my $self = shift; local $_ = $self->SUPER::test_via_harness( @_ ); s/PERL_DL_NONLAZY=1//g; return $_; }

Replies are listed 'Best First'.
Re^3: How to avoid having to remove PERL_DL_NONLAZY=1 from Makefile?
by tlm (Prior) on Mar 31, 2005 at 22:11 UTC

    Try this:

    use ExtUtils::MakeMaker; package MY; sub test_via_harness { my($self, $perl, $tests) = @_; local $_ = $self->SUPER::test_via_harness($perl, $tests); s/PERL_DL_NONLAZY=1//g; return $_; } sub test_via_script { my($self, $perl, $tests) = @_; local $_ = $self->SUPER::test_via_script($perl, $tests); s/PERL_DL_NONLAZY=1//g; return $_; } package main; # rest of your Makefile.PL

    the lowliest monk

      I chatted with people about this. Apparently $self is blessed into PACK001 which is not ISA anything useful. The proper thing to do is call directly into the MM class (not ExtUtils::MM though). The following code is what actually works. I'm getting a taste of why ExtUtils::MakeMaker is being killed. Yuck. I hope it dies a quick death.

      sub MY::test_via_harness { local $_ = shift()->MM::test_via_harness( @_ ); s/\bPERL_DL_NONLAZY=1 +//g; return $_; } sub MY::test_via_script { local $_ = shift()->MM::test_via_script( @_ ); s/\bPERL_DL_NON_LAZY=1 +//g; return $_; }

        Yeah, it's a mess:

        DB<1> c 13 MY::CODE(0x853f698)(Makefile.PL:13): 13: local $_ = $self->SUPER::test_via_script($perl, $tests); DB<1> p $self PACK001=HASH(0x8387700) DB<2> x \@PACK001::ISA 0 ARRAY(0x8768988) 0 'MM' DB<3> x \@MM::ISA 0 ARRAY(0x83cccb8) 0 'ExtUtils::MM' DB<4> x \@ExtUtils::MM::ISA 0 ARRAY(0x83ccb14) 0 'ExtUtils::MM_Unix' 1 'ExtUtils::Liblist' 2 'ExtUtils::MakeMaker' DB<6> x \@ExtUtils::MM_Unix::ISA 0 ARRAY(0x8481508) 0 'ExtUtils::MM_Any' DB<7> x \@ExtUtils::MM_Any::ISA 0 ARRAY(0x8538cc4) 0 'File::Spec'

        the lowliest monk