counting characters in a message sent by a basebal

Run Settings
LanguagePerl
Language Version
Run Command
# Here is a program to count the numbers of each character # show n in the "Input" tab below. If you click "Run" the # pregram will run and show you the answer in the "Output" # box. while (<>) { foreach my $character (split //) { if ($character =~ "\n") { $counted{"\\n"}++ ; } else { $counted{$character}++ ; } } } foreach my $character (sort {$counted{$a} <=> $counted{$b}} keys %counted) { print "$character \t $counted{$character}\n"; }
Editor Settings
Theme
Key bindings
Full width
Lines