in reply to Removing Duplicates from Hash of Hash of id3 information
Hi smgfc,
I answer to your suggestion to you the full path to an mp3 as the hash key this is not a good idea. Think about a file system. Each file at a given location occurs once and only once, therefore if the path is equal so too is the file. You won't be able to find duplicate song residing in different locations like this.
My feeling is that you would be best to use a far purer key for the hashes. I suggest you create a first hash that contains just artist name, this maps to a second hash called song title, which maps to a third hash called track info (which can be used to store detail about the individual MP3 such as its location). What you are trying to build is a complex data structure so I would urge you to look at perlman:perldsc and perlman:perllol. I might even go so far as to say that creating an object to store in your hash might be a good idea to encapsulate data... perlman:perltoot and perlman:perlobj.
Of course any solution relies on good ID3 tags for files so some sort of handling routine for when these don't contain enough info will be necessary. I.e. extract and check the ID3 before placing into hash, don't do it on the fly. But then thats always the fun of trying to organise an MP3 collection.
As an aside the best tool I know for refactoring MP3 tags is Tag&Rename. Check it out... very handy.
Anyway, hope this helps.
____________
|
|---|