Last active
January 4, 2016 18:19
-
-
Save redhotpenguin/8659953 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $paragraph = <>; | |
my @words = split(/\s+/, $para); | |
my %counts; | |
foreach my $word (@words) { | |
$counts{length($word)}++; | |
} | |
foreach my $count (keys %counts) { | |
my $num = $counts{$count}; | |
print "$num words with $count letters\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment