in reply to Displaying an array in a cgi generated textarea
An array in double quotes (which equals qq//) is interpolated and the result is ...
print "left @array right"; # try perl -MO=Deparse for that: print 'left '.join($",@array).' right'
So you see, perl uses $" as the seperator of the array elements, $" is by default just a single space character, you can simply change that. Use local() to avoid problems with other code, because CGI.pm afaik uses $", too.
local $" = ''; #... -default => "@source", #... #or even -default => do { local $" = ''; "@source" }, #or better -default => join('',@source)
HTH, see perlvar
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Displaying an array in a cgi generated textarea
by martymart (Deacon) on Feb 27, 2003 at 18:31 UTC |