|
|
| P is for Practical | |
| PerlMonks |
RE: Return a Unique Arrayby sergio (Sexton) |
| on Feb 25, 2000 at 19:44 UTC ( #4395=note: print w/ replies, xml ) | Need Help?? |
|
GrassHopper! Always read the books. In the Perl Cookbook you can find
my %seen =() ;
@unique_array = grep { ! $seen{$_}++ } @non_unique_array ;
Which makes the soul happier!
In Section
Snippets Section
|
|
||||||||||||||||||||