Michael Fowler <[EMAIL PROTECTED]> wrote:
>> @data[0] = ("", "", "");
>> #and
>> @data[1] = (1, 2, 3);
>
>This notation is almost certainly incorrect, what you probably meant to say
>is:
>
> $data[0] = ["", "", ""];
> $data[1] = [ 1, 2, 3];
You're right, I wrote a wrong syntax.
>> I want to make @data[0] on the fly without "for" structure and it should
>> have the same number of elements as @datumi2.
>
>Your restriction that it not use a for loop to construct the data is
>needlessly limiting. There are several ways to do what you ask, one of them
>is a for loop.
I didn't like idea where "for" is used for adding elements one by one..
otherwise I don't have anything at all against using it. ;)
> push(@{ $data[0] }, "") for (0 .. $#datumi2);
>
>OR
>
> push(@{ $data[0] }, "") for @dataumi2;
Does $_ change in these two examples? (due cycling trough @datumi2)
> $data[0] = [("") x @datumi2];
>
>
>Each has strengths and weaknesses.
Can you explain where are these strengths(which one is the fastest?)
--
Matija
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]