Hi all,

I have a section of perl code that builds a hash from the results of a
select on a database. This is as follows:

$SITE{$row->{'id'}} = { 'URL' => $row->{'url'},
                        'CLIENT' => $row->{'client'},
                        'YNUMBER' => $row->{'ynumber'},
                        'DATE' => $row->{'date'},
                      };

This is returned to the calling function as a hashref (\%SITE) and this
hashref is passed to my template processing function ($site).

To get this hashref and print the contents of this in perl, I do the
following :

my $site_list = get_sitelist();

# DEBUG CODE 
# Uncomment to test get_sitelist
foreach my $key (keys %$site_list) {
       print "Key: $key\tValue: $$site_list{$key}->{'CLIENT'}\n";
}

Is there any way to do this in a template using Template::Toolkit ? If there
is no way of doing this in Template::Toolkit, what is the right way of
building the hash then ? The HTML that I want to end with is
<li><a href="URL">CLIENT</a> - YNUMBER - DATE</li>
<li><a href="URL">CLIENT</a> - YNUMBER - DATE</li>
<li><a href="URL">CLIENT</a> - YNUMBER - DATE</li>

Where each of those lines has one of the URL's, CLIENT's, YNUMBERS and
DATE's from my database.

Any help here would be much appreciated.

Regards,

-- 
Wayne Pascoe <[EMAIL PROTECTED]>

The price of freedom is eternal vigilance
   - Thomas Jefferson



Reply via email to