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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: PERL TO HTML FORM
by Chrisf (Friar) on Jan 05, 2002 at 21:53 UTC
    If you just want to display certain text in the fields just print the form element out with the text as the value.

    You could use any of the various html template modules or just print a here document...

    #!/usr/bin/perl -w use strict; my $text = "Display this"; print <<END_HTML; <form action="blah.pl"> <input type="text" name="stuff" value="$text" /> <input type="submit" value="Submit"> </form> END_HTML
Re: Perl to HTML Form
by Spenser (Friar) on Jan 07, 2002 at 08:32 UTC

    Here's a basic layout that I would offer you.

    #!/usr/bin/perl -w use CGI qw/:standard :html3/; my $q = new CGI; my $var = "100"; print $q->header( -type=>'text/html'), $q->start_html(), $q->start_form(-method=>'post', -action=>"another.cgi"), "Enter Item Number: ", $q->textfield(-name=>'var_data', -size=>'6', -value=>"$variable"), $q->end_form, $q->end_html; exit;

    This will put data in the textfield and will allow the user to edit it before moving onto the next script (another.cgi).  Note, the commas, semi-colons, quotes, and double-quotes are not arbitrary.  You also need to have the CGI perl module installed on your server--I don't think it's standard issue with Perl.

    That's Spenser, with an "s" like the detective.