Firstly you don't need all those my $c =..., but the error is because you sent a hash not a hash reference (also print $template->output).:
sub validate { my @params = @_; my @warning; for ( @params ) { my %h = ( missing => $_); push (@warning, \%h ) unless $c->param($_); } if ( @warning ) { print $c->header; my $template = HTML::Template->new(filename => './templates/warnin +g.html'); #don't use die $! while testing HTML::Template has it's own error +handling $template->param( warnings => \@warning ); print $template->output(); exit; } }
"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce
In reply to Re: Error when passing AoH ref to HTML::Template
by kutsu
in thread Error when passing AoH ref to HTML::Template
by silent11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |