Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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


Comment on Re: Most elegant way to dispose of duplicates using map
Download Code

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 lurking in the Monastery: (16)
As of 2014-08-01 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (25 votes), past polls