http://qs321.pair.com?node_id=906020

lindsay_grey has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way to create a list of unique strings that will also eliminate strings that are exact substrings of another string? For example, if i have AGCT, AGGT, GG, and AGCT, I only want to keep AGCT and AGGT. The direct string comparison approaches I have been reading about would, I think, consider AGGT and GG different, for example if I just create a hash using the strings as keys or use cmp.

I see I can choose one string and for each through the others comparing each pair using match, but I was wondering if there was a more efficient way as I have hundreds of sets of strings, each containing about 100,000 strings, and each string is about 300 characters long.

Thank you.