in reply to removing duplicates from a string list
Use a hash to store the IDs. Since hashes always have unique keys, you'll get automatic duplicate removal.
See also: perlintro, perldata, perlretut.