Forum Moderators: coopster & phranque

Message Too Old, No Replies

Remove Duplicates

         

carfac

1:36 pm on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi:

I have some lists I would like to have perl parse, and remove any duplicate elements. For instance, a list might be:

"132, 62, 18, 62, Michael Moore, Batman, 132, Moore, Batman"

and I would like that to return:

"132, 62, 18, Michael Moore, Batman, Moore"

Any easy way to do this?

Thanks!

Dave

Birdman

2:07 pm on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

This link should help:

Extracting Unique Elements from a List [iis1.cps.unizar.es]

You'll have to get your list into an array first. I think split will do that for you.

Birdman

carfac

3:06 pm on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Birdman:

I have to split the list into an array anyway, so that works great! Thank you very much for the pointer!

Dave