L
Lee
Hey I have a hash table with many many keys. In each entry, the value
is a counter and so my code goes something like:
my %hash=();
while (statement){
$key="blabla";
if (!$hash{$key}){
$hash{$key}=1;
}
elsif ($hash{$key}){
$hash{$key}++;
}
}
How would I speed this up? Someone told me that using the following
code instead would work, but it hasn't.
my %hash=();
while (statement){
$key="blabla";
$hash{$key}++;
}
is a counter and so my code goes something like:
my %hash=();
while (statement){
$key="blabla";
if (!$hash{$key}){
$hash{$key}=1;
}
elsif ($hash{$key}){
$hash{$key}++;
}
}
How would I speed this up? Someone told me that using the following
code instead would work, but it hasn't.
my %hash=();
while (statement){
$key="blabla";
$hash{$key}++;
}