You may like:
my %hash = map {$_ => undef} @keys;
or:
my $hashRef = {foo => {map {$_ => undef} @keys}};
for the nested key hash ref version.
In reply to Re: How to create a hash whose values are undef?
by GrandFather
in thread How to create a hash whose values are undef?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |