in reply to Anagrams & Letter Banks

next if $seen{$key}++; push @{$words{$signature}}, $_;

You've already received some excellent answers, I just wanted to touch on your questions about these two lines of code. Both of them involve the concept of autovivification, where elements of data structures are brought into existence simply by referring to them.

The postincrement operator ++ first returns the old value of its argument and then increments it (the argument $seen{$key}, not the returned value). This means that if the key does not yet exist in the hash, it will return the undefined value, which in the boolean (scalar) context of if evaluates to false, then brings the hash entry into existence, with a value of 1 (Update 2: because undef in numeric context is 0, so 0+1=1, and in this special case there is no warning about using undef in a numeric operation). The next time this key is encountered, that means that the operator returns the previous value of 1, which is true, so the next is executed, thereby skipping duplicates. Since the increment is also executed, this also means that the values of the hash count how many times each key is seen.

In the second case, the array dereference operation @{} tells Perl explicitly that you expect that hash element to contain an array reference, so if the hash element does not yet exist, it will be brought into existence as an empty anonymous array, so then it can be pushed onto.

As for your questions about for and $_, I find that the first few paragraphs of Foreach Loops explains this fairly well.

Update: I strongly recommend you Use strict and warnings, also have a look at the Basic debugging checklist.

Update 2019-08-17: Updated the link to "Truth and Falsehood".