Hello Everyone.
I have the following code:
### CODE BLOCK ###
my %hash_of_arrays2;
for (keys %hash_of_arrays) {
my @array_of_data = exists($hash_of_arrays{$_})
[EMAIL PROTECTED]
:();
my $mean = mean([EMAIL PROTECTED]); #GET MEAN
my $std_dev = dev([EMAIL PROTECTED]); #GET STANDARD DEV
push @{$hash_of_arrays2{$_}}, $mean;
push @{$hash_of_arrays2{$_}}, $std_dev;
}
for (sort {$hash_of_arrays2{$a}[0] <=> $hash_of_arrays2{$b}[0]}
keys %hash_of_arrays2) {
print "$_, $hash_of_arrays2{$_}[0], $hash_of_arrays2{$_}[1]\n";
}
### END OF CODE ###
If anyone has the time could you please show me ways of shortening this
code e.g. eliminating the second for block (integration into the
previous block) and any other tips / tricks.
There are no other people here that code perl and so I get no
advice/feedback on how to improve my scripts.
Thanks in advance.
Dan.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>