my %id_count; $id_count{ $hash{ $_ } }++ for grep /:213119_at:/, keys %hash;