Help for this page

Select Code to Download


  1. or download this
    ++$t,++$c{$_}for map/\w/g,<>;
    print$_,' ',$c{$_},' ',$c{$_}/$t*100,$/for sort keys%c;
    print"Total: $t\n"
    
  2. or download this
    ++$t, ++$c{$_} for map /\w/g, <>;
    for ( sort keys %c ) {
    ...
        printf "%-5s%5d%7s%%\n", $_, $c{$_}, $p;
    }
    print 'Distinct: ' . (scalar keys %c) . "\tTotal: $t\n"