my $key1 = '00001'; my $key2 = 1; my %hash1 = (1 => 1); my %hash2 = (1 , 2); my %hash3; $hash3{$key1} = 3; my %hash4; $hash4{$key2} = 4; #### 00001 == 1 That is: $key1 == $key2 00001 ne 1 That is: $key1 ne $key2 $hash1{$key1} is undef $hash1{$key2} == 1 $hash2{$key1} is undef $hash2{$key2} == 2 $hash3{$key1} == 3 $hash3{$key2} is undef $hash4{$key1} is undef $hash4{$key2} == 4