Mailing List Archive

Re: [MM] New OO attribute mechanism does not work
In-Reply-To: <memo.347962@cix.compulink.co.uk>
> The answer is:
> When the hintsfile is checked, you can access the hash reference
> $self, which is the thingie, that was called %att in former times. So
> if you want to do the equivalent to
> > $att{LIBS} = ['-ldbm -lucb -lc'];
> you would now say
> > $self->{LIBS} = ['-ldbm -lucb -lc'];

Tried this. It does not work. There are two problems: check_hints is
not called as an OO method, so no $self is passed. Secondly no blessed
$self is available anyway. At the point at which check_hints is called,
$self has not been blessed. Suggested patch follows:

*** MakeMaker.pm.orig Tue Oct 31 16:13:20 1995
--- MakeMaker.pm Mon Nov 13 13:18:31 1995
***************
*** 221,227 ****
check_manifest();
}

- check_hints();

$self = {} unless (defined $self);

--- 221,226 ----
***************
*** 253,258 ****
--- 252,259 ----
@{"$class\:\:ISA"} = 'MM';
}

+ $self->check_hints();
+
if (defined $ExtUtils::MakeMaker::Parent[-2]){
$self->{PARENT} = $ExtUtils::MakeMaker::Parent[-2];
my $key;

The exact location of the $self->check_hints() line may not be exactly
correct, but it does seem to work.

Alan Burlison aburlison@cix.compulink.co.uk
Re: [MM] New OO attribute mechanism does not work [ In reply to ]
>>>>> "alan" == Alan Burlison <aburlison@cix.compulink.co.uk> writes:

alan> In-Reply-To: <memo.347962@cix.compulink.co.uk>
>> The answer is:
>> When the hintsfile is checked, you can access the hash reference
>> $self, which is the thingie, that was called %att in former times. So
>> if you want to do the equivalent to
>> > $att{LIBS} = ['-ldbm -lucb -lc'];
>> you would now say
>> > $self->{LIBS} = ['-ldbm -lucb -lc'];

alan> Tried this. It does not work. There are two problems: check_hints is
alan> not called as an OO method, so no $self is passed. Secondly no blessed
alan> $self is available anyway. At the point at which check_hints is called,
alan> $self has not been blessed. Suggested patch follows:

Thanks for the patch. The version I sent to Andy yesterday has moved
the check_hints sub further down, but not as far as you suggest. I
don't think, it is helpful to call check_hints after blessing. If we
let check_hints call arbitrary MM methods, we would make the whole
process uncontrollable.

$self should IMO be nothing but a hash ref. It is now, it was not for
MM 5.04 if WriteMakefile was called without an argument, that's fixed
now.

After a big electricity dropout in the whole University I just managed
to upload MakeMaker 5.06 to CPAN, and I hope, funet can fetch it
within a reasonable amount of time. After the dropout all our routers
are under very heavy load, and I hope we're back to normality tonight.

andreas