- or download this
for my $elem (@phrase) {
$wordfreq{$elem}++;
}
- or download this
# or even shorter, but perhaps a bit unreadable:
$wordfreq{$_} for (@phrase);
- or download this
$wordfreq{$_}++ for (@phrase);
- or download this
foreach my $key (sort keys %wordfreq) {
print "$key: $wordfreq{$key}\n";
}