[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] Converting an array of strings into a scalar



I have an array of lines, each one containing a newline character at the
end.  I want to convert this to a scalar variable that I will pass on to
something else.

I was using
$body = "@filecontents";

But that ends up adding a space to the beginning of each line except the
first one.  So I changed it to this:

$body = '';
foreach $line (@filecontents) {
  $body .= $line;
  }

But I wonder if there is a more elegant way?

-Ryan