in reply to Filling a matrix
Hello David92,
The main problem is this line:
@valueArray = ([$version,$totSP]);
which simply overwrites the whole array on each iteration of the innermost loop. Replace it with this:
push @valueArray, [$version, $totSP];
Also, please put
use strict; use warnings;
at the head of your script, and declare all variables explicitly as lexicals by using my:
for my $folderId (keys %hash) { for my $customer (keys %{$hash{$folderId}}) { for my $version (keys %{$hash{$folderId}{$customer}}) { my $totSP = $hash{$folderId}{$customer}{$version}{totSP}; push @valueArray, [$version, $totSP]; } } }
— and note how much easier it is to read code which is indented consistently. ;-)
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|