in reply to Cluster a big bunch of strings

As another easy non-perl solution, you might consider loading them into postgres and using the native full text search, and its indexing possibilities.

Indexed searches are fast.