On Tue, Oct 19, 2004 at 03:13:17PM -0400, Darren Chamberlain said:
> You'll need to change the push to be:
> 
>   push @emails, {
>       from => "fred",
>       to => "wilma",
>       subj => $subj,
>       date => "today"
>   };
> 
> I.e., push a hashref instead of an arrayref of a hashref.  That should
> get you going...


On a style note you might also think about changing it to

        my $subj = get_email_subj($ref[0]);
        
        push @emails, {
       from => "fred",
       to => "wilma",
       subj => $subj,
       date => "today",
           file => $ref[0],
   };



and then in the template where you currently have

        <td>[% email.subj %]</td>

do this instead

        <td>
                <a href="crm.pl?action=show_email&file=[% email.file %]">
                        [ % email.subj %]
                </a>
        </td>

Since that way you have better seperating of concerns.

It might make things easier in the future if you want to do a 
redesign, generate the content in a different format (XML, Excel, WML, 
PDF etc etc) or even if you decide to move the app to mod_perl or change 
the name of the cgi from crm.pl to damn_customers.pl ;)

Simon


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to