hook 'after_template_render' => sub { my($html) = @_; if(my $values = $global{fill_in_values}) { my %opt = %{ $global{fill_in_opt} }; $opt{invalid_class} //= "validation-error"; $opt{fill_password} //= 0; $opt{clear_absent_checkboxes} //= 1; if( $global{invalid_fields} ) { $opt{invalid_fields} = $global{invalid_fields}; } my $output = HTML::FillInForm->fill( $html, $values, %opt ); $$html = $output; } };