http://www.perlmonks.org?node_id=68448

blackjudas has asked for the wisdom of the Perl Monks concerning the following question: (hashes)

I have an array that keeps returning matches in a string, each match must be inserted into a hash as an empty key, this is what I have and it's obviuosly flawed.

keys(%hash) = @array;

Or should I go the route:
my $var = 0; $var = @array; for ($i = 0; $i <= $var; $i++) { %hash = ($array[$i] => ""); }


Any takers?

Originally posted as a Categorized Question.