Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://581333]
[Corion]: A fresh module escapes into the morning twilight of Github. HTTP::Generator, produces cartesian products of your HTTP parameters to create more HTTP requests
[Corion]: But it still needs lots of documentation and more tests before I can release it. Also adapters to turn the data structure into HTTP::Request objects and Dancer::Request, Mojo::Request and Plack::Request

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2017-01-20 11:52 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.