Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: xtracting unique lines

by Happy-the-monk (Monsignor)
on Mar 27, 2012 at 18:22 UTC ( #961991=note: print w/ replies, xml ) Need Help??


in reply to xtracting unique lines

I'd split the pairs by the " + " string, sort {$a cmp $b} the pair into a temporary array. Use as hash key a string joined by the " + " string made of that array... and the original string as the hash value. When done print out all the values.

To shorten it, make the split, sort and join in one go and you get rid of the temporary array.

Cheers, Sören


Comment on Re: xtracting unique lines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-08-20 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (121 votes), past polls