ENQUIRY WHETHER SCRIPT FOR DETECTING WORDS FROM A SET OF LETTERS EXISTS

Hello,
I am interested in finding out whether someone has a perl or awk script which takes a set of letters such as wak and referring to a dictionary spews out all possible forms such as awk, kaw etc.
If someone has such a script, could it be put up please. The script should handle Unicode.
Many thanks