A few comments, naturally:
my %h1 = %{ $_[0] }; #h2 similar
This will make the code more portable/general/cleaner. You may add an extra check for hashiness.my %h1 = (defined $_[0] and ref $_[0]) ? %{ $_[0] } : ();
Had to think extra carefully there!scalar grep { my ($a, $b) = ( $h1{$_}, $h2{$_} ); ( not defined $a and defined $b ) or ( not defined $b and defined $a ) or $a ne $b } @k1
Hope this helps,
Jeroen
In reply to Re:{3} How to test equality of hashes?
by jeroenes
in thread How to test equality of hashes?
by acser
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |