John W. Krahn wrote:
M. Lewis wrote:
I now we can push (concatenate) data onto an array.
I would assume that we could concatenate data on to a string as well
with something like:
$newstring = $oldstring . $newdata
Yes.
Maybe this isn't correct though. I've not yet tried it.
My question is
To push something to an array:
push(@array, $data);
To push something onto a scalar:
$scalar = $scalar . $data;
-or-
$scalar .= $data;
The better method depends entirely on what you intend to do with the
data and how you have it. It is also very easy to both split a string
into an array,
@arr
M. Lewis wrote:
>
> I now we can push (concatenate) data onto an array.
>
> I would assume that we could concatenate data on to a string as well
> with something like:
>
> $newstring = $oldstring . $newdata
Yes.
> Maybe this isn't correct though. I've not yet tried it.
>
> My question is one