@containeeArray is a hash of hashes containing references to the same kind of hashes as in @containerRefArray. After I get the index of the container containing %$object, in following code I look up the corresponding entry in @containeeArray. I then sort the hash in $containeeArray
$i and then return the position in this sortted hash of %$object.
That was the plan anyway.
Here's the rest of the fns
<CODE>
sub sort_objects {
$a->{'~entPhysicalIndex'} <=> $b->{'~entPhysicalIndex'}; }
sub get_parentRelPos (\%$) {
my ($object, $name)=@_;
my ($i, $j, $found);
my (@tmp, $dummy);
my $parentObject=$object->{'~PARENT'};
my $objectIndex=$object->{'~entPhysicalIndex'};
if (ref $parentObject ne 'HASH') {
confess "parent object wasn't a hash";
return -1; }
for ($i=0; $i < @containerRefArray; $i++) {
if ($containerRefArray
$i eq $parentObject) {
$found=1;
last;
}
}
if ($found) {
# Call the code in each contained object to obtain the entPhysicalIndex of each one and then sort them (references in containeeArray point to tied hashes)
# 1:
# sorting with sort sort_objects @{$containeeArray
$i} didn't work for some reason ??
# 2:
# @tmp=@{$containeeArray
$i};
# 3:
# foreach $dummy (@{containeeArray
$i}) {
# push @tmp, $dummy;
# }
# none of the above 3 methods seem to work right
@tmp = sort sort_objects @tmp;
for ($j=0; $j < @tmp; $j++) {
if ($tmp
$j eq $object) {
return
$j+1;
}
}
}
return -1;
}
<\CODE>