foreach my $word(split /\s+/, $input) { $everything {$word}++; $words++; }