in reply to extra spaces in textarea

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

Replies are listed 'Best First'.
Re: Re: extra spaces in textarea
by ja (Initiate) on Jan 11, 2002 at 19:48 UTC
    Thank you all for your ideas and input. I have tried your suggestions to no avail. The extra space is being added when the form entry is being written to the text file ie in the saves part. This is evident when I take a look at the text file.

    I have tried this script on multiple servers and with different browsers with the same result. Im sure it does not have quotes.

    jeffa i do not understand alot of what you have said. Why is it bad to mix html with perl?? Is this a functional or speed issue?? Of interest I tried adding use(strict) and got pages of errors.

    Anyone have a magic bullet??
    James