sub equate2 { my ($self, $other, $mapping) = @_; foreach my $row_index (0..$#$mapping) { return 0 if (grep { ($$self{Matrix}[$row_index][$_] != $$other{Matrix}[$$mapping[$row_index]][$$mapping[$_]]); } (0..$#$mapping)); } return 1; }