Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Displaying an array in a cgi generated textarea

by fruiture (Curate)
on Feb 27, 2003 at 18:18 UTC ( #239187=note: print w/replies, xml ) Need Help??

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 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
    Thanks fruiture,
    just tried it... works great,
    valuable lesson learned...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://239187]
[stevieb]: so, it's -34c today, and some of my water pipes are frozen and one burst. sigh
[stevieb]: it doesn't seem as though "there's an app for that"
[ambrus]: burst water pipe sucks
[Corion]: ambrus: Ugh - yes, that really sucks!
[stevieb]: good thing is that both sides of the break are completely frozen, so I was able to shut off the water to the building before any water leaks. I told the landlord last year to insulate that specific area better
[Corion]: stevieb: Our SV overlords don't know what "frozen pipe" means and think it's something like "frozen yogurt"
[ambrus]: huh... what does "SV" mean there?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2016-12-08 18:10 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (144 votes). Check out past polls.