In article <[EMAIL PROTECTED]>, Kevin Old wrote: [...] > Then the rest of the lines are "Tracks" and "Artists". What I need to > do is get the appropriate tracks and artists in respective (@tracks, > @artists) arrays inside the hash. > > Basically, I need to know how to write code that does this: > > Get the 3 albums to be processed, put title in hash with UPC as key > (done with code above) > > Parse next 16 lines (3 tracks and artists on each line) and associate > them with the proper song & artist arrays in the hash. This is what I have so far (using slightly different variable names). I still need to strip out the first line ("MADE FAMOUS BY" and "TRACK") and remove quote marks, but is the format you want?
The thing to add (I'd have to check the Perl Cookbook for the terminology) is a "reverse lookup"(?) so that in addition to: $album{$upc} you could also access your data via: $album{$album_name} (I think -- trying to remember this from what I've read)... $VAR1 = { '0-84296-21712-0' => { 'artists' => [ '"MADE FAMOUS BY"', '"BROOKS & DUNN"', '"TOBY KEITH"', '"TIM McGRAW"', '"CHRIS CAGLE"', '"KENNY CHESNEY"', '"STEVE HOLY"', '"BRAD PAISLEY"', '"PHIL VASSAR"', '"TOMMY SHANE STEINER"', '"TRAVIS TRITT"', '"JOE DIFFIE"', '"SOGGY BOTTOM BOYS"', '"GARTH BROOKS"', 'LONESTAR', '"EMERSON DRIVE"', '"TOBY KEITH' ], 'tracks' => [ 'TRACK', '" 1. THE LONG GOODBYE"', '" 2. MY LIST"', '" 3. THE COWBOY IN ME"', '" 4. I BREATHE IN..."', '" 5. YOUNG"', '" 6. GOOD MORNING BEAUTIFUL"', '" 7. WRAPPED AROUND"', '" 8. THAT\'S WHEN I LOVE YOU"', '" 9. WHAT IF SHE\'S AN ANGEL"', '"10. MODERN DAY BONNIE & CLYDE"', '"11. IN ANOTHER WORLD"', '"12. I AM A MAN OF CONSTANT SORROW"', '"13. WRAPPED UP IN YOU"', '"14. NOT A DAY GOES BY"', '"15. I SHOULD BE SLEEPING"', '"16. I WANNA TALK ABOUT ME"' ], 'name' => 'COUNTRY FEMALE PARTY SONGS VOL. 1' }, '0-84296-33172-7' => { 'artists' => [ '"MADE FAMOUS BY"', '"PATSY CLINE"', 'ALABAMA', '"DOLLY PARTON"', ETC.... -- Kevin Pfeiffer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]