#!/usr/bin/env perl -n0 $t++,$c{$_}++ for /./g; printf("%s\t%d\t%.3f\n", $_, $c{$_}, $c{$_} / $t) for keys %c; print "Total: $t\n"