# This is called by foo() from the main application, just before # to display the page # sub foo_view { my $template = shift; my $date = shift; my $missing = shift; my $invalid = shift; $template->param( "missing_$_" => 1 ) for @$missing; $template->param( "invalid_$_" => 1 ) for @$invalid; # [...] return $template; }