http://qs1969.pair.com?node_id=821941


in reply to Template::Latex not interpolating variables . . .

All template variables should be put between [% %] to get processed

Replies are listed 'Best First'.
Re^2: Template::Latex not interpolating variables . . .
by hesco (Deacon) on Feb 08, 2010 at 06:54 UTC
    Yes, of course. Thank you ahmad. I no longer get the literals passing through the filter, but my variables still are not being interpolated. Now I am seeing:

    \textbf{} & box & : & & \\ \hline \hline \textbf{} & box & : & & \\ \hline
    where my template now reads:

    [% FOREACH recipient IN call_list %] \textbf{[% recipient.email %]} & box & [% recipient.uid %]: [% rec +ipient.name %] & [% recipient.fname %] [% recipient.lname %] & [% rec +ip ient.phones %] \\ \hline [% FOREACH sponsor IN call_list.recipient.upstream %] \multicolumn{2}{||r|}{[% sponsor.email %]} & [% sponsor.uid %] +: [% sponsor.name %] & [% sponsor.fname %] [% sponsor.lname %] & [% s +po nsor.phones %] \\ [% END %] \hline [% END %]
    if( $lal && $lol ) { $life++; }
    if( $insurance->rationing() ) { $people->die(); }

      If your desired data is not shown, then you might be using the wrong data structure (Your hashref is not what you have expected).

      Try using Data::Dumper to print out content of your hashref and see if it's indeed what you want.

      If you still have problems with it, post the output of "print Dumper($call_list);" so I can have a look into it.

        Ahmed: Here is a quick sample of some sanitized data. The arrayref assigned to the 'upstream' key consists of anonymous hashes with essentially the same data and keys as are assigned to the email address key to the call_list hashref. My script walks recursively through the data to build that anonymous array of 'upstream sponsors' for my client's sales team.

        This all looks right to me, but this is my first time using Template::Latex, though I have some experience with Template::Toolkit and HTML::Template.

        Do you see what I'm missing here? I sure don't and have been stumped on this one for a couple of days.

        Thanks for your help, for the second set of eyes.

        -- Hugh

        $VAR1 = { 'call_list' => { 'this_email@yahoo.com' => { 'phone3' => '', 'uid' => '5999', 'fname' => 'Lynn', 'name' => 'ljames', 'phones' => '917-555-1212', 'upstream' => [ { 'phones' => undef } ], 'lname' => 'James', 'phone1' => '917-555-1212', 'phone2' => '' }, 'another_email@yahoo.com' => {
        if( $lal && $lol ) { $life++; }
        if( $insurance->rationing() ) { $people->die(); }