Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Most elegant way to dispose of duplicates using map

by borisz (Canon)
on Oct 30, 2006 at 16:30 UTC ( #581333=note: print w/ replies, xml ) Need Help??


in reply to Most elegant way to dispose of duplicates using map

Hope this is what you have in mind.
sub extractPartTuplesFromURL { my $cgi = shift; my @partTuples = $cgi->param('partID'); my %dupes; @partTuples = map { my @t = split(','); $dupes{ $t[0] }++ ? () : +{ id => $t[0], version => $t[1], classification => $t[2] } } @partTuples; return \@partTuples; }
Boris

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2016-06-29 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (368 votes). Check out past polls.