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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://581333]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found