Thanks for the help.

I'm really trying to keep my code out of my templates. In fact, that is why I opted to use TT2 in the first place. I have a web designer working on this project who doesn't understand TT2 or Perl.

It appears that other template tools (like Template::HTML) allow you to pass arrays to templates. I have written code code that basically builds an array of hashes. Its fairly compact. This would work for Template::HTML, but not for TT2.

I think I have to create a hash of hashes. Unfortunately, I'm not sure how to do this syntactically - and this is where I could use a little help.

Am I heading down the right path? My thought is to create a hash for each relevant record in the table. Then, I can create a hash of hashes to encompass all of the records. However, if I send the HoH to TT2, will it understand it? This is uncharted territory for me. Also, I'm not sure how the syntax works for building a HoH in Perl. I'm still researching this, but haven't figured it out (help appreciated).

I guess the other thing I could do is take my existing array of hashes and parse it with Perl to build one large hash. I'm sure this would work (I've done something similar in the past) but one would think there exists an easier (preferred) way to do all of this. Hence my post here for the Monks.

I really appreciate any further guidance you experts can offer me.

:-)

In reply to Re^2: Best way to send records to the browser? by Perobl
in thread Best way to send records to the browser? by Perobl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.