calculate the value in an array of array

2006-08-18 Thread chen li
Dear all, I have an array of array look like this: @array_of_array=( [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5] ) How do I get the total values for each colume, such as $column1=1+1+1+1; $column2=2+2+2+2; $column3=3+3+3+3; ... Thanks,

RE: calculate the value in an array of array

2006-08-18 Thread Nagasamudram, Prasanna Kumar
-Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Friday, August 18, 2006 7:00 PM To: beginners@perl.org Subject: calculate the value in an array of array Dear all, I have an array of array look like this: @array_of_array=( [1,2,3,4,5

Re: calculate the value in an array of array

2006-08-18 Thread Dr.Ruud
chen li schreef: > I have an array of array look like this: > > @array_of_array=( > > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5] > ) > > How do I get the total values for each colume #!/usr/bin/perl use warnings ; use strict ; m

Re: calculate the value in an array of array

2006-08-18 Thread John W. Krahn
chen li wrote: > Dear all, Hello, > I have an array of array look like this: > > @array_of_array=( > > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5] > ) > > How do I get the total values for each colume, such as > > $column1=1+1+1+1;

Re: calculate the value in an array of array

2006-08-18 Thread Rob Dixon
chen li wrote: > > I have an array of array look like this: > > @array_of_array=( > > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5] > ) > > How do I get the total values for each colume, such as > > $column1=1+1+1+1; > $column2=2+2+2+2; >

Re: calculate the value in an array of array

2006-08-18 Thread Dalibor Straka
On Fri, Aug 18, 2006 at 06:29:36AM -0700, chen li wrote: > Dear all, > > I have an array of array look like this: > > @array_of_array=( > > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5], > [1,2,3,4,5] > ) > > How do I get the total values for each col

Re: calculate the value in an array of array

2006-08-18 Thread Dr.Ruud
Dalibor Straka schreef: > chen li: >> @array_of_array=( >> [1,2,3,4,5], >> [1,2,3,4,5], >> [1,2,3,4,5], >> [1,2,3,4,5] >> ) >> >> How do I get the total values for each colume > > it might be smart(depends on utilization) to keep the sum as the 0th >

Re: calculate the value in an array of array

2006-08-19 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > > I have an array of array look like this: > > > > @array_of_array=( > > > > [1,2,3,4,5], > > [1,2,3,4,5], > > [1,2,3,4,5], > > [1,2,3,4,5] > > ) > > > > How do I get the total values for each c

RE: calculate the value in an array of array

2006-08-19 Thread Charles K. Clarkson
chen li wrote: : $total[ $column ] += $row->[ $column ]; : : Can you or anyone else explain it a bit more? It is short for this. $total[ $column ] = $total[ $column ] + $row->[ $column ]; HTH, Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate Web Programmer 254 96