in reply to Remove duplicated data from array ref

Hi,

You haven't told us what the problem is, but the code you posted does not compile because you're using barewords like 887ww45 instead of quoted strings, so that would be the first thing to fix - replace the square brackets with quotes (i.e. [887ww45] becomes "887ww45") and your code will work. It's not particularly efficient though, mostly because of the grep. Please see the following links:

I wish I could to this without having to add the new values to a new variable.

While it's possible to solve this without a second data structure, it's a bit easier to code using more than one. Why would you want to avoid a second data structure, is your actual data very big?

Hope this helps,
-- Hauke D

Update: Added quote.