Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use warnings;
- use strict;
- my %count;
- $count{$_}++ for split //,$ARGV[0];
- print "$_->{char}: $_->{count}\n" for
- sort { $b->{count} <=> $a->{count} }
- map { { char => $_, count => $count{$_} } } (keys %count);
Advertisement
Add Comment
Please, Sign In to add comment