my @letters = qw(d u n s c a e y t); open(D,"/usr/dict/words") or die $!; my @words = f(@letters); print "$_\n" for @words; sub f { # 1 2 3 4 5 6 #234567890123456789012345678901234567890123456789012345678901234 $;=join'?',sort@_,$;;grep{chop;(join'',sort split//)=~/^$;$/} } __END__ =head1 SAMPLE OUTPUT ace aces acne act acted acute ad ads an and [SNIP] uneasy unsteady [SNIP]