in reply to Counting lines starting with a unique string

Well, you can. perl -ne '/^(.\d{4})/ && $seen{$1}++; END { print "$k seen $v times\n" while ($k,$v) = each %seen }' ____________
Makeshifts last the longest.