use warnings; my %hash1 = ( test => 3 ); my %hash2 = ( bobby => 15, what => 'thehell' ); print "good\n" if %hash1->{'test'} < %hash2->{'bobby'}; print "good1\n" if $hash1{'test'} < $hash2{'bobby'};