perlnewbee has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I am creating a HTML webpage with a user submission form box. How do i write a script to gather that information typed in and display the output in the same HTML page appending each input as a new table at the end of the page. appreciate your assistance

Replies are listed 'Best First'.
Re: Help with HTML and Perl scripting
by moritz (Cardinal) on Nov 12, 2007 at 09:08 UTC
    You should use CGI to extract the posted data, and a templating system (like HTML::Template, HTML::Template::Compiled, Template) to build the HTML tables.

    Finally you have to store the data across different calls of the CGI script, you can do that either in a file (see perlopentut), or if you want more flexibility, in a database using DBI.

Re: Help with HTML and Perl scripting
by ww (Archbishop) on Nov 12, 2007 at 13:55 UTC
CGI::Dump shows the form state
by Your Mother (Archbishop) on Nov 12, 2007 at 16:54 UTC

    If you're just looking for the most simple feedback, this is what I often do. For situations where I am just throwing a quick feedback form up or something and don't need to parse/reuse the data, I like this shortcut.

    use strict; use warnings; use CGI qw(:standard); print header(), start_html(), start_form(), textfield("one"), br(), checkbox_group(-name => "list", -values => [qw(me mi mo mu)]), br(), textarea("text"), br(), submit(), end_form(), CGI::Dump(), # <-- Right here end_html();
Re: Help with HTML and Perl scripting
by perlnewbee (Initiate) on Nov 13, 2007 at 08:37 UTC
    Thank You all..Yes being a newbee its challenging but the advice helps me get started ....as in most cases Tutorials are great...they have tons of information but as I start reading them I get lost...and thats where I turn back here for help...will try the solutions and let you know how it goes