my %hash; my $a = undef; my $b = ''; $hash{$a} = 'foo'; print "$hash{$a}\n"; print "$hash{$b}\n";

Of course both these throw a warning. C:\temp>hash.pl Use of uninitialized value in hash element at C:\temp\hash.pl line 8. Use of uninitialized value in hash element at C:\temp\hash.pl line 9. foo foo