perlquestion
blackjudas
hash
array
element
key
insert
slice
match
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.<br><br>
<CODE>keys(%hash) = @array;</code><br><br>
Or should I go the route:<br>
<code>
my $var = 0;
$var = @array;
for ($i = 0; $i <= $var; $i++) {
%hash = ($array[$i] => "");
}
</code>
<br><br>
Any takers?
<p><i>Originally posted as a Categorized Question. </i></p>