I have come unstuck trying to debug textarea. I have read all the docs I can think of and done all the searches I can think of. So I know that for debugging a POST action with a textarea I really need to include

use CGI qw(-debug);
This means I get prompted for the parameters. However I really need the textarea to be multiline and when I look at the value returned by the textarea it only ever includes the first line. However when I run it a normal server/browser way all the lines are present. So what am I doing wrong when debugging.

Edit: I can produce a simple example. The following script suffices:

use CGI qw(-debug); use strict; use warnings; my $cgi = CGI->new; print $cgi->param('a');
If this is called "a.pl" you can then debug it as
perl -d a.pl
At which point the following happens:
perl -d a.pl Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(a.pl:5): my $cgi = CGI->new; + + DB<1> n (offline mode: enter name=value pairs on standard input; press ^D or ^ +Z when done) a='a b v d' main::(a.pl:6): print $cgi->param('a'); + + DB<1> p $cgi->param('a') a b v d + + DB<2> q
Okay I have worked out how to get more than the first line, but the fact that they are separate lines is lost.

In reply to Debugging textarea by SilasTheMonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.