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