I also could have done this in storable, but storable's freeze and thaw are broken on ultrasparc/solaris. So I used Data::Dumper. You get the idea, and could switch over to Storable to make it faster if you were so inclined.
Suggested usage:
my @newarray = grep { hcmp( \%goodhash, $_ ) } @somebadhashes;
sub hcmp { use Digest::MD5 qw{ md5_hex }; use Data::Dumper; my ($a, $b) = @_; my $astr = md5_hex( Dumper( $a ) ); my $bstr = md5_hex( Dumper( $b ) ); return ($astr eq $bstr) ? 1 : 0; }
In reply to compare two hashes inefficiently. by deprecated
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |