for (sort keys %words) { my @list = sort @{$words{$_}}; next unless @list > 1; next unless grep !/(.).*\1/, @list; print "@list\n";