I want to create a hash: keys will be first met different words, the value is a reference to anon array with anagrams of this key.
I wrote the following code, which works when the amount of words is in range (0 to a few thousand) but I want to make it faster.
Below is my way to check if a string is an anagram. I iterate for all words and for all keys of the hash.
join("", sort(split (//, fc($word)))) eq join("", sort(split (//, fc($key)))))