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,

@array = split(/pattern_to_split_over/, $string); # note that the
pattern can just be //, to split every character into its own element
of the array

and to make an array into a string:

foreach (@array) { $string .= $_; }

One thing to note, though, is that array operations in Perl (push(),
splice(), etc.) are wicked fast.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to