in reply to How can I assign the elements in an array to only the key values in a hash?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How can I assign the elements in an array to only the key values in a hash?
by Benedictine Monk (Novice) on Apr 01, 2001 at 08:47 UTC |