Re: Strings vs Arrays

2006-12-30 Thread M. Lewis
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

Re: Strings vs Arrays

2006-12-30 Thread Leonid Grinberg
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

Re: Strings vs Arrays

2006-12-30 Thread John W. Krahn
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

Strings vs Arrays

2006-12-29 Thread M. Lewis
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 Maybe this isn't correct though. I've not yet tried it. My question is one method 'better' than the other? If so,