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

Perl newbie here,

How do output a line or multiple lines to the textarea box? Here is the form code.

use CGI qw(:standard); print header; print start_html(-title=>"Spellchecker", -BGCOLOR=>"black"); print hr; print start_form; print p(submit("Check Spelling"), textfield("hold")); print textarea(-name=>'foo', -rows=>10, -columns=>36); print end_form;
Thank You
-chet

Edit kudra, 2002-05-03 Added P and CODE tags

Replies are listed 'Best First'.
Re: textarea output
by cjf (Parson) on Apr 24, 2002 at 19:01 UTC

    Take a look at populating a textarea

    You may also want to check out some alternatives to CGI.pm for generating HTML documents such as HTML::Template. Then again, you may not :).

Re: textarea output
by Cyrnus (Monk) on Apr 25, 2002 at 06:53 UTC
    You can use param() to change or set the value of a form field. Here is an example:
    #!/usr/local/bin/perl -w use CGI qw(:standard); param("foo","You can\nMake it multiline\noutput too"); print header; print start_html(-title=>"Spellchecker", -BGCOLOR=>"black"); print hr; print start_form; print p(submit("Check Spelling"), textfield("hold")); print textarea(-name=>'foo', -rows=>10, -columns=>36); print end_form;