rashley has asked for the wisdom of the Perl Monks concerning the following question:
I have this sub, that takes a cgi param and splits it up into a list of hashes:
What I need to do is get rid of the duplicates bassed on "id", or better yet, prevent them from getting in my list to begin with.sub extractPartTuplesFromURL { my $cgi = shift; my @partTuples = $cgi->param('partID'); @partTuples = map { my @t = split(','); {id=>$t[0], version=>$t[1], classification=>$t[2]} } @partTuples; return \@partTuples; }
I'm sure I could slug through this, but everything I've come up with is very clunky, and I'm sure there is a more "monkish" way to do it.
Thoughts? Thanks!
|
---|