Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Extract Duplicates by one liner

by dmorelli (Scribe)
on Mar 04, 2005 at 15:56 UTC ( [id://436615]=note: print w/replies, xml ) Need Help??


in reply to Re: Extract Duplicates by one liner
in thread Extract Duplicates by one liner

Getting golfy over here, but you don't even need the $_ if part:

@a=qw/foo bar bar baz/; print join ", ", grep { !$h{$_}++ } @a;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found