David92 has asked for the wisdom of the Perl Monks concerning the following question:
My problem occurs when I want to fill my matrix / array. I have a HASH that contains some values:
%elohimHash{$folderId}{$customer}{$version}{points} = $totPoints;
I want to draw a Pie Chart using Google charts, so I need to create an HTML. This is not important part, as this is already done.My problem is to fill my array in a the way as it is described at the bottom of this question.
Check the code:
What I'd like to get is a Pie chart that will display all the version with their POINTS.foreach $folderId (keys %elohimHash){ foreach $customer (keys %{$elohimHash{$folderId}}){ foreach $version (keys %{$elohimHash{$folderId}{$customer}}){ $totSP = $elohimHash{$folderId}{$customer}{$version}{totSP}; @valueArray = ([$version,$totSP]); }}}
So my array should look like: @valueArray = ([version1, points1],[ version2,points2],[version3,points3]); etc. depending how many versions are there in Hash.
Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filling a matrix
by Athanasius (Archbishop) on Aug 08, 2014 at 12:20 UTC | |
|
Re: Filling a matrix
by Random_Walk (Prior) on Aug 08, 2014 at 15:17 UTC | |
by Laurent_R (Canon) on Aug 08, 2014 at 17:54 UTC | |
|
Re: Filling a matrix
by Anonymous Monk on Aug 08, 2014 at 12:04 UTC | |
by David92 (Sexton) on Aug 08, 2014 at 12:16 UTC | |
by Anonymous Monk on Aug 08, 2014 at 12:31 UTC | |
|
Re: Filling a matrix
by bulrush (Scribe) on Aug 09, 2014 at 11:49 UTC | |
by AppleFritter (Vicar) on Aug 09, 2014 at 16:47 UTC | |
by Anonymous Monk on Aug 09, 2014 at 19:28 UTC | |
by AppleFritter (Vicar) on Aug 09, 2014 at 23:20 UTC |