in reply to Re: Excel::Template and a hash of arrays of hashes
in thread Excel::Template and a hash of arrays of hashes

Thank you wfsp, that did the job perfectly! I owe you a beverage of your choice sometime.

The code:
my @outer; foreach my $rep (sort keys %hash) { my @inner; foreach my $detail (@{ $hash{$rep} }) { push @inner, $detail; } push @outer, { rep => $rep, inner => \@inner, } } $template->param( { outer => \@outer } );
The XML:
<workbook> <loop name="outer"> <worksheet name="$rep"> <row> <cell text="Comp_Recid" /> <cell text="ApplicationType" /> <cell text="State" /> <cell text="Count (*)" /> </row> <loop name="inner"> <row> <cell text="$companyid" /> <cell text="$apptype" /> <cell text="$state" /> <cell text="$count" /> </row> </loop> </worksheet> </loop> </workbook>

---
It's all fine and dandy until someone has to look at the code.