So we build an array of categories (with fields reveresed), then a hash of descriptions, then create an array of strings for every description, prime for outputting to a file.use File::Slurp; my @cats = map { chomp; map [reverse split ','], split /\|/; } read_file('your_category_file'); my %desc = map { chomp; split ',', $_, 2; } read_file('your_description_file'); my @res = map { my $d = $_; join '|', "$d,$desc{$d}", map { join ',', @$_ } grep { $_->[0] =~ /^$d?/ } @cats } keys %desc; print "$_\n" for @res; __output__ 'BB','Drinks Industry'|'BB100','Coffee Suppliers'|'BB106','Tea Supplie +rs' 'BL','Construction Industry'|'BL100','Plasterers'|'BL102','Fencing Com +panies'
_________
broquaint
In reply to Re: Multidimensional array of hashes
by broquaint
in thread Multidimensional array of hashes
by robbiebow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |