I'm sure there's an easier/better way of doing this, but in the interest of
simplicity, let's look at this approach:

First, a red flag goes up when you say that you have an array of 12
numbers.  Will it always be twelve?

The second red flag is that you are splitting the array into quarters based
on the fact that you need the calculations done for every three numbers.
Again, will this always be three?  Why?  More importantly, why are they not
already in separate lists/arrays?

Enough of that.  Here is a simple solution for splitting the arrays up:

use strict;
use Statistics::Lite
# Takes a reference to an array and returns a list of references to arrays.
sub arr_split {
 my @arr = @{shift(@_)};
 my @new_arr = ();


On 8/15/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:


>>>I have an array contains 12 numbers. I want to
>>>calculate the mean and standard deviation for very
>>>three numbers. I just wonder which math module is
>>>available to do the job.
>>
>>Wonder no longer :) Find out for sure:
>>
>> http://search.cpane.org/
>
>
>
> I think you meant http://search.cpan.org.  :)

Indeed :)

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



Reply via email to