> sub equals { > my ($self, $obj) = @_; > > return $self eq $obj; > }
Correct me if I'm wrong someone, but it seems that this would only evaluate if the hashrefs are equal (which wouldn't happen unless you did $obj->equals($obj)). How about this? sub equals { my ($self, $obj) = @_; foreach my $key ( keys(%$self) ) { return FALSE unless ( defined($obj->{$key}) and $self->{$key} eq $obj->{$key} ); } return TRUE; } -man