Wise ones, I seek assistance!
Having returned to PERL after not long enough on glorious beaches, I'm floundering with a nested array of hashes. I'll try to explain:
I have a pipe-delimited text file, each line representing a 'Category'. Within each Category is a number of Items, each with a description and reference number. Here's an example:
'Coffee Suppliers','BB100'|'Tea Suppliers','BB106'I also have another file with the Category descriptions in. For example:
'BB','Drinks Industry'What I want to do is:
(a) reverse the order of first set of records so that the reference is first, then the description (so I can use these as hashes / associative arrays when I read the data normally); and
(b) merge the two sets with the second set of data being popped onto the beginning of each category array.
(As you have guessed, the first two characters of the Item reference are the same as the Category reference.)
The outcome would be:
'BB','Drinks Industry'|'BB100','Coffee Suppliers'|'BB106','Tea Suppliers'Any advice gratefully received.
In reply to Multidimensional array of hashes by robbiebow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |