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