I am surprised that no one solved this problem as I would have:
-
first reduce all email addresses to a canonical form by removing trailing blanks, reducing characters to lowercase, etc.
- then sort using the default lexical sort
- finally loop through the resulting list once, seeing whether any two addresses in a row are the same. If they are then delete the first and move on.
"There's more than one way to do it"
-- Larry Wall, the genius who invented and guides perl to this day. He is to us what Linus is to home UNIXers.