replace class's ISA instead of prepending to it

This commit is contained in:
Graham Knop 2009-10-19 05:05:02 -05:00
parent d852c58a90
commit cdbc94cdef
2 changed files with 12 additions and 6 deletions

View file

@ -43,10 +43,6 @@ sub import {
my @propertyList;
my %properties;
if ( my $properties = delete $definition->{properties} ) {
# accept a hash and alphabetize it
if (ref $properties eq 'HASH') {
$properties = [ map { $_ => $properties->{$_} } sort keys %{ $properties } ];
}
for (my $i = 0; $i < @{ $properties }; $i += 2) {
my $property = $properties->[$i];
push @propertyList, $property;
@ -109,7 +105,8 @@ sub import {
*{$super . '::set'} = \&_set;
*{$super . '::update'} = \&_update;
*{$super . '::instantiate'} = \&_instantiate;
unshift @{$caller . '::ISA'}, $super;
@{$super . '::ISA'} = @{$caller . '::ISA'};
@{$caller . '::ISA'} = ($super);
return;
}