On 18/4/02 1:39 pm, "darren chamberlain" <[EMAIL PROTECTED]> wrote:

> * Wayne Pascoe <[EMAIL PROTECTED]> [2002-04-18 07:36]:
>> Hi all,
> 
> Hi, Wayne.
> 
>> I have a section of perl code that builds a hash from the results of a
>> select on a database. This is as follows:
> 
> [-- snip --]
> 
>> 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 ?
> 
> Of course there's a way to do it:
> 
> [% FOREACH id = SITE.keys %]
>     <li><a href="[% SITE.$id.URL %]">[% SITE.$id.CLIENT %]</a> - [%
> SITE.$id.YNUMBER %] - [% SITE.$id.DATE %]</li>
> [% END %]
> 
> They key is to use SITE.$id in the block.

Perfect! Thanks a stack for that.

I thought that maybe my hash was built in the wrong way. This works a treat
though!

Thanks again,

-- 
Wayne Pascoe <[EMAIL PROTECTED]>

The price of freedom is eternal vigilance
   - Thomas Jefferson



Reply via email to