#!/usr/bin/perl use strict; use warnings; my %hash1 = ( 'a' => [1, 2, 3], 'b' => [4, 4, 3], 'd' => [5, 2, 'H'], ); my %hash2 = ( 'a' => [1, 2, 3], 'd' => [5, 'f', 'H'], 'c' => [8, 'r', 9], ); for my $schluessel (keys %hash1) { if ($hash2{$schluessel}) { if (join(",", @{$hash1{$schluessel}}) eq join(",", @{$hash2{$schluessel}})) { print "Schluessel $schluessel in beiden ok.\n"; } else { print "Schluessel $schluessel in beiden nicht ok.\n"; } } else { print "Schluessel $schluessel nur in hash1.\n"; } } for my $schluessel (keys %hash2) { unless ($hash1{$schluessel}) { print "Schluessel $schluessel nur in hash2.\n"; } }