Another hint - sort the keys in order of ascending length, so you have all the short words ready for deletion in the hash when the longer words get examined.
In reply to Re^2: retain longest multi words units from hash
by Corion
in thread retain longest multi words units from hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |