perl -nle"++$h{ $1 } while m[(\S+)]g } { print qq[$_ : $h{ $_ }] for keys %h" hugeFile