in reply to Clubbing array elements together:
$/ = q(); while (<>) { s/\n//g; print "$_\n"; } [download]
Though, I think you have the right idea, the array will most likely originate from a file-read.
So it's obviously a XY Problem and should be solved directly.