- or download this
#old snippet
if (exists ( $genus {$hit[2]})) {
...
} else{
$genus{$hit[2]} = 1;
}
- or download this
#new snippet
$genus{ $hit[2] }++
- or download this
%genus = { } ; #genus is empty
$genus{ foo }; #requests foo entry, and throws away.
#genus is now { foo => undef }
$genus{ foo } ++; # genus is now { foo => 1 }