Digioso has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use warnings; use strict; use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; my $cgi = CGI->new(); print $cgi->header, # create the HTTP header $cgi->start_html(-title=>"Test", -author=>'webmaster at digioso.org'); if($ENV{'REQUEST_METHOD'} eq 'GET') { print qq{<form action = "textareatest.pl" name = "form" method = " +post"> <textarea name = "text" cols = "50" rows = "10"></text +area><br/> <input type = "submit"/> </form>}; } elsif($ENV{'REQUEST_METHOD'} eq 'POST') { my $text = $cgi->param('text'); print qq{$text<br/>}; } else { print "Unknown request method!<br/>"; } print "</body></html>"; exit 0;
|
|---|