On May 19, Randy W. Sims said: >Hmm, none of the solutions so far have been stable. In other words all >the solutions so far modify the order of elements from the source array. >How would you implement a version of the function that produced an array >where the elements are in the same order and only the first of any >duplicates are kept? > >( a b c d e f g h ) == stable_uniq( a b c d a b e f c g h )
You've been shown how to do it with grep(), but Tie::Array::Unique is stable, or at least it has been in all my tests. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ CPAN ID: PINYAN [Need a programmer? If you like my work, let me know.] <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>