in reply to extra spaces in textarea
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 '@arr = 1..10; print @arr; print "@arr"' 12345678910 1 2 3 4 5 6 7 8 9 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:% 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
{ # 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 |