http://www.perlmonks.org?node_id=950223


in reply to ASCII file

Untested:
use autodie; open my $fh "<", "ASCIIFILE"; my @c; while (<$fh>) {$c[ord]++ for split //} for ($_ = 0; $_ < @c; $_++) { printf "'%s' occurs %d times\n", chr, $c[$_] if $c[$_]; }