my %count; foreach( @protein ) { $count{ $_ }++; ... };