in reply to Next from inner loop only works "most of the time"
All three of of your loops use the same global variable ($_). Declare a lexical variable for at least two of them.
#UNTESTED RESULT: foreach my $wrd(@result) { my %seen; $seen{$_}++ for (split //,lc $_); foreach my $ltr (keys %seen) { next RESULT if ($seen{$ltr} > $master_letter_freq{$ltr +}); } print "$_\n"; }
UPDATE: Thanks to jo37 (below),I now believe that the original code 'should' work.
Bill
In Section
Seekers of Perl Wisdom