how to join array into array
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.perl.misc Profile…
 Up
how to join array into array         


Author: Tradeorganizer
Date: May 6, 2007 03:46

Hi

I am having two array example below :

@x;
@y;

values in x and y are :

$x[0] = (1,2,3,4)
$x[1] = (2,3,4,5)
....
till
$x[31] = (1,1,1,1)

now the value of y contains

$y[0] = (2,2,3,4)
$y[1] = (2,3,3,5)
....
till
$y[31] =(4,4,4,4)
.....

till
$y[500] = (1,1,1,1)
Show full article (0.98Kb)
4 Comments
Re: how to join array into array         


Author: Michele Dondi
Date: May 6, 2007 04:40

On 6 May 2007 03:46:31 -0700, Tradeorganizer
gmail.com> wrote:
>Hi

Hi
>I am having two array example below :
>
>@x;
>@y;

Yes...
>values in x and y are :
>
>$x[0] = (1,2,3,4)
>$x[1] = (2,3,4,5)

You're missing the semicolons, btw.

Anyway, this does not make much sense: you have a list assigned to a
scalar. The above is perfectly equivalent to

$x[0] = 4;
$x[1] = 4;

Perhaps you mean
Show full article (1.78Kb)
no comments
Re: how to join array into array         


Author: John W. Krahn
Date: May 6, 2007 08:19

Tradeorganizer wrote:
>
> I am having two array example below :
>
> @x;
> @y;
>
> values in x and y are :
>
> $x[0] = (1,2,3,4)
> $x[1] = (2,3,4,5)
> ....
> till
> $x[31] = (1,1,1,1)
>
> now the value of y contains
>
> $y[0] = (2,2,3,4)
> $y[1] = (2,3,3,5)
> .... ...
Show full article (1.36Kb)
no comments
Re: how to join array into array         


Author: Tad McClellan
Date: May 6, 2007 09:49

Tradeorganizer gmail.com> wrote:
> values in x and y are :
>
> $x[0] = (1,2,3,4)

Please speak Perl rather than English, when possible.

$x[0] = [1,2,3,4];
> $x[1] = (2,3,4,5)
> ....
> till
> $x[31] = (1,1,1,1)

Wouldn't having just 2 or 3 illustrate your problem just as
well as having 32 of them?
Show full article (1.62Kb)
no comments
Re: how to join array into array         


Author: Tradeorganizer
Date: May 6, 2007 10:50

On May 6, 8:19 am, "John W. Krahn" example.com> wrote:
> Tradeorganizer wrote:
>
>> I am having two array example below :
>
>> @x;
>> @y;
>
>> values in x and y are :
>
>> $x[0] = (1,2,3,4)
>> $x[1] = (2,3,4,5)
>> ....
>> till
>> $x[31] = (1,1,1,1)
>
>> now the value of y contains
>
>> $y[0] = (2,2,3,4)
>> $y[1] = (2,3,3,5) ...
Show full article (1.79Kb)
no comments