Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Extract Duplicates by one liner

by Taulmarill (Deacon)
on Mar 07, 2005 at 09:50 UTC ( [id://437169]=note: print w/replies, xml ) Need Help??


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

sorry, my above code was untested. this should work.
my @foo = qw/1 2 3 4 5 6 1 3 6 9 4 6/; for my $i ( map {$_} @foo) { @foo = ( ( grep { $_ ne $i } @foo ), $i ); } print join ", ", @foo; print "\n"

on second sight i think this is a very strange way of doing this. other methods posted in this thread may be better.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found