http://qs321.pair.com?node_id=336857

jdtoronto has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed Monks,

I am using HTML::Template in an application where I would like pass it a hash of hashes. Sadly, it doesnt support this type of structure.

Has anyone out there a module, or even a subroutine, that will parse a hash of hashes into a set of heirarchical template variables?

The alternative is to write something that "flattens" out the data, but this would be rather "not general purpose" which is what I would prefer.

My structure looks like this (it is only a part of a much larger structure):

$VAR1 = { 'apptimeupdated' => '20040315145142', 'appdate' => '2004-03-15', 'personellid' => '0', 'appscref' => '', 'apptime' => '16:45:00', 'appdesc' => '', 'appid' => '270', 'apptype' => { 'taxlc' => '0', 'apt_requ_qual' => '', 'apt_abbr_desc' => '001', 'taxst' => '0', 'apt_defstatus' => { 'name' => 'Pending', 'css_class' => 'pending' +, 'id' => '1', 'graphic' => '/images/te +nt.jpg' }, 'taxfed' => '0', 'value' => '50', 'apt_full_desc' => 'Round, regular - 18 holes +', 'apt_requ_prepay' => '1', 'apt_requ_option' => '', 'providerid' => '4', 'id' => '1' }, 'appamountpaid' => '0', }
jdtoronto