Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to make an array from an array?

by barrd (Canon)
on Dec 06, 2003 at 14:47 UTC ( #312769=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @all_names = qw/john andy bill andy john julia bill/;
    my %seen = ();
    my @names = grep { ! $seen{$_} ++ } @all_names;
    print join(' ', @names);
    
  2. or download this
    my @names = sort grep { ! $seen{$_} ++ } @all_names;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://312769]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2022-06-29 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (97 votes). Check out past polls.

    Notices?