#!/usr/bin/perl use warnings; use strict; chomp(my @words = ); foreach my $word (@words) { my $count{$word} += 1; } foreach my $key (sort keys %count) { print "$key was found $count{$key} times\n"; }