Rhesa Rozendaal wrote:
Robert Hicks wrote:
Currently with HT I do this:

my $template = $self->load_tmpl('reports.tmpl.html');

$template->param(
     title => 'Trakker :: Reports Page',
data => $data, );

$template->param($errs) if $errs;

That implies that $errs is a reference to a hash.

I tried converting that to this:

my %params = (
     title => 'Trakker :: Reports',
     data => $data,
);

# I imagine this is totally wrong?!
%params = (
     errs => $errs,
) if $errs;

Depends on what your intention was, but here you're overwriting the contents of %params, so you lose the title and data keys.


That is what I thought...

What you probably want is _adding_ the contents of $errs to %params:

# using slice
@params{ keys %$errs } = values %$errs if $errs;


That worked perfectly. Thank you very much!

Thanks for all the help ladies and gentlemen.

Robert


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to