Are you sure your print statement is print @arr not print "@arr"? They have different default behavior for what gets printed between the elements...
% perl -le '@arr = 1..10; print @arr; print "@arr"' 12345678910 1 2 3 4 5 6 7 8 9 10
If you really are getting an extra space using print @arr you might want to check the value of $, which is usually an empty string...
% perl -le '$, = ""; print 1..10' 12345678910 % perl -le 'print 1..10' 12345678910 % perl -le '$, = " "; print 1..10' 1 2 3 4 5 6 7 8 9 10 % perl -le '$, = " abc "; print 1..10' 1 abc 2 abc 3 abc 4 abc 5 abc 6 abc 7 abc 8 abc 9 abc 10
If someone has globally modified the value of $, they deserve to be slapped with a trout, but a quick fix for you is to locally reset the value where its causing you problems:
{ # set up new enclosing scope since we are modifying globals local $,; # temporarilly set $, back to the empty string print "<center><textarea name=head rows=6 cols=60 wrap=soft>\n"; print @linesHead; # <- wont see extra spaces here... print "</textarea></center>\n"; } # end enclosing scope... $, is back to its old value

-Blake


In reply to Re: extra spaces in textarea by blakem
in thread extra spaces in textarea by ja

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.