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.
What you probably want is _adding_ the contents of $errs to %params:
# using slice
@params{ keys %$errs } = values %$errs if $errs;
# or more verbosely:
if($errs) {
while( my ($k, $v) = each %$errs ) {
$params{ $k } = $v;
}
}
HTH,
Rhesa
---------------------------------------------------------------------
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]