Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: xtracting unique lines

by Happy-the-monk (Abbot)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961991]
help
Chatterbox?
[Lady_Aleena]: shmem, sorry I was outside for a moment moving my car out of hubby's way.
[Lady_Aleena]: shmem, there is ONE song which throws a wrench in the works for both MP3::Info and MP3::Tag.
[shmem]: Lady_Aleena: fix it, or delete it ;-)
[Lady_Aleena]: shmem, I'm not sure how.
[shmem]: well, deleting is done with 'rm' :-P

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-04-23 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.