use strict; use warnings; my $wordlist = <) { chomp $deadstring; next unless length $deadstring; $hashlist{$deadstring} = 1; } my $wordCount = keys %hashlist; if ($wordCount) { print "Found $wordCount words:\n"; print join "\n", sort keys %hashlist, ''; } else { print "Didn't find any words\n"; } #### Found 5 words: a cat mat sat the