I don't think there is anything in your example that could cause that...

On a sidenote, your CGI style could be improved. You import functions with :standard and then use the OO interface. Do one or the other. I prefer the functions unless you need to pass the CGI object around code. Here is a revamp of your code with a security and JS printing fix. Never send unescaped user input back to the browser. Paragraphs do not separate content, they encapsulate it. And please, please, please use CSS instead of things like -BGCOLOR=>'lavender'.

use warnings; use strict; use CGI qw( :standard ); use CGI::Carp qw( fatalsToBrowser ); use HTML::Entities qw( encode_entities ); my $js = <<"EOF"; function sub_dispatcher() { document.sql_tool.submit(); } EOF print header(), start_html(-title => 'Selection ', -script => [ $js ] ), startform(-name => 'sql_tool'), p( textarea(-name => 'sql', -default => 'SELECT * FROM Departments', -id => 'textarea1', -rows => 14, -cols => 70), ), p( button(-name => 'save2file', -value => 'execute write-in (above)', -onClick => "sub_dispatcher()"), ), endform(), hr(), ; my $sql = param('sql'); print h3("From textarea: "), pre( encode_entities($sql) || "n/a" ), ;

In reply to Re: Curious Bug Entering Textarea by Your Mother
in thread Curious Bug Entering Textarea by lev

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.