while ($line = ) { chomp($line); ($value, $key) = split(/=/, $line); if(exists $hash{$key}) { if(($hash{$key}) eq $value) { print "YES: ", ($hash{$key}) ," == $value\n"; } else { print "NOT: ", ($hash{$key}) ," != $value\n"; } } }