html-formhandler
html-formhandler copied to clipboard
result render fails
I discovered something strange. Consider this example:
my $result;
{
my $form = MyApp::Form->new( .... );
$result = $form->run( params => $params );
}
print $result->render();
result:
core - template - undef error - Can't call method "render_start" on an undefined value at /usr/local/share/perl5/HTML/FormHandler/Widget/Form/Simple.pm line 25
Looking at your code, I see this:
$form = $self->form;
...
$form->render_start($result)
Maybe because the form, which is a "my" variable, is removed after the block ends, and only the "result" attribute is preserved? Does the result object contain a lazy reference to its parent form?