Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^4: Remove duplicate entries

by kcott (Canon)
on Nov 17, 2010 at 17:11 UTC ( #872020=note: print w/replies, xml ) Need Help??

in reply to Re^3: Remove duplicate entries
in thread Remove duplicate entries

Your inner loop is iterating based on the number of elements in @gp_name but you are increasing the length of that array with push @gp_name, $key;.

I suggested a lookup table and envisaged something like:

my %group_table = ( 'On' => 'One', 'Two' => 'Two', 'Twel' => 'Twelve', 'Twen' => 'Twenty', ... );

So, if "Group " is common to all keys, strip that off. Then take increasingly larger substrings from what's left until you get a match. Include some limit so when you've tried X characters and still found no match, give up and put that item in a separate "bucket" for manual intervention.

-- Ken

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2016-10-22 20:17 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (297 votes). Check out past polls.