in reply to Obtaining number of counts per each name in hash
You want to increment the value of the key as each occurrence is found:
And then later:$name{$hashkey}++;
print "$_ $name{$_}\n" for keys %name;
You could trim up your code a bit as well:
if ($line =~ /(\S+)/) { $name{$1}++; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|