[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: use base peculiarities



>>>>> On Wed, 19 Jan 2000 14:12:05 -0800, Gurusamy Sarathy <gsar@ActiveState.com> said:

 > On 19 Jan 2000 22:49:29 +0100, Andreas J. Koenig wrote:
>>>>>>> On Wed, 19 Jan 2000 11:27:02 -0700, Tom Christiansen <tchrist@chthon.perl.com> said:
>> The disregard of %INC is due to the very fact that you describe.
>> *Because* a "base package" doesn't imply the existance of a physical
>> file, base.pm cannot take %INC into account.

 > But that doesn't help, because we ass_u_me a physical file when we do
 > a C<require "$base"> anyway!


We C<require> *after* we have checked $VERSION. We do not C<require>
if $VERSION exists. This is quite a bit less disturbing than trying
and retrying to load a package that is already there.

Maybe I'm missing something in which case I'd ask for code to beat on.

In any case, the following needs to work (Sarathy, maybe this should
become t/lib/base.t?):

./perl -Ilib -e ' 
package Testing::Base;
sub inheritme {42};
package Testing::Bar;
use base "Testing::Base";
package main;
my $bar = bless [], "Testing::Bar";
print $bar->inheritme == 42 ? "" : "not ", "ok 1\n";
'
ok 1


-- 
andreas


References to:
Gurusamy Sarathy <gsar@ActiveState.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]