in reply to Re^2: compare values within hash
in thread compare values within hash

my @a1 = @{$hash{key1}}; my @a2 = @{$hash{key2}};

You can avoid the copying by using references:

my $a1 = $hash{key1}; my $a2 = $hash{key2}; ... if ($a1->[$i] eq $a2->[$i]) {

which is functionally the same as

if ($hash{key1}->[$i] eq $hash{key2}->[$i]) {

but less to type if you need to access the arrays ($a1/$a2) more than once...