You will need two functions in your Perl program:
So, I would introduce an URL parameter, say, action, which is either display (or empty) for the display action and save for the save action. Output something like the following HTML in the display action:
<input type="hidden" name="action" value="save">
You will likely also want to offer the user an option to reset their input:
<a href="?action=display;row=$current_row_identifier">Reset changes</a +>
You decide which part of your program to execute based on the action value:
my $action = param('action') || 'display'; if( $action eq 'save' ) { ... } elsif( $action eq 'display ) { ... } else { # Weird error };
Personally, I would look into Mojolicious or Dancer for doing the scaffolding of the web part of the application, but as they both are frameworks, you will have to learn some stuff not tightly related to creating the HTML and talking to the database. It is also quite feasible to do all you need with just Perl and print statements for the HTML generation.
In reply to Re^4: Perl: info from database into a form(HTML)
by Corion
in thread Perl: info from database into a form(HTML)
by alen129
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |