If i judge by your code, you want empty values. Anyway empty keys does not make sense. Because each key of a hash must be unique within the hash set of keys
$hash{$_}= '' for @array;
usually conunting number of matches for each strings makes more sense:
$hash{$_}++ for @array;
-- stef
In reply to Re: How can I assign the elements in an array to only the key values in a hash?
by stefp
in thread How can I assign the elements in an array to only the key values in a hash?
by blackjudas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |