in reply to Re: Re: Re: Re: Unique array w/o repeated elements and still keep the original order!
in thread Unique array w/o repeated elements and still keep the original order!
Er just a thought but any time ive written that code ive ended up changing it to
or something like it (i dont always use %_ but sometimes i do, blame ABIGAIL-II ;-)my @unique=map{chomp; $_{$_}++ ? () : $_} <FILE>;
To be honest i think that in my perl career ive only used a grep a few times. map seems to be so much more useful in that it can do grep()s job, and more as well!
Yves / DeMerphq
---
Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)
In Section
Seekers of Perl Wisdom