in reply to Undefined Hash Values and Ternary Operators

i'm not sure what the problem is. i tried your code above for initializing %H and $H{y} was never 'z'. the following code also works for me:
my $undef_var = undef; my %hash; @hash{foo, bar, baz} = (1, $undef_var, 2); for (sort keys %hash) { printf "%s => %s\n", $_, defined $hash{$_} ? $hash{$_} : 'unde +f'; }