in reply to Merging Arrays without duplicates
Sounds suspicously like a homework problem...but anyway, if you don't care about order, just dump them all into a hash. If you do care about order, there are some modules in CPAN that will do the trick: Tie::IxHash, Tie::Hash::Indexed, Tie::LLHash. If want to preserve order and cook it yourself, one way to do it is to make a hash with the data from one of the arrays (probably the larger), then iterate through the other array, pushing onto the first array any elements in the second array that aren't found in the hash.
-b
|
|---|