in reply to Array question

You need to define what kind and how much similarity is significant. Does 'axolotl' disqualify 'algiz'?

Your example suggests that $_ = [split /-/]; may be helpful, in conjunction with (as always with uniqueness problems) a hash, $hash{$_->[0]} = $data if not exists $hash{$_->[0]};.

Why do you tie the file to @text and then go ahead and work with the redundant *FILE? On many systems, opening *FILE first guarantees that *FILE will not see the results of the shuffle.

This is my hopefully last question....

I hope not :-)

After Compline,
Zaxo