in reply to Re^3: Size of a HASH (with more keys)
in thread Size of a HASH (with more keys)
Everything is inside one Hash called %testHash.$testHash{$year}{$status} = $getNumbers; -> $testHash{2014}{Open} = 5; -> $testHash{2014}{Closed} = 2; -> $testHash{2014}{Cancled} = 3; etc.
I posted a LINK above to where you can see how JSONP file format should look like. That is why I need commas inbetween sentences, BUT not at the last sentence.
I use like this:
I did not copy/paste the code, so there might be silly syntax errors in there.foreach $key (keys %testHASH){ foreach $key2 (keys %{$testHASH{key}}{ $getNumbersOpen = $testHASH{$year}{$status}{opened}; $getNumbersClosed = $testHASH{$year}{$status}{closed}; $line = "'$status' : {'Open: $getNumbersOpen, 'Closed': $getNumbersClo +sed},\n; ----> If loop to remove the comma <---- print $outfile "$line\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Size of a HASH (with more keys)
by Corion (Patriarch) on Jul 02, 2014 at 13:02 UTC | |
Re^5: Size of a HASH (with more keys)
by AnomalousMonk (Archbishop) on Jul 02, 2014 at 13:29 UTC | |
Re^5: Size of a HASH (with more keys)
by LanX (Saint) on Jul 02, 2014 at 13:08 UTC | |
by David92 (Sexton) on Jul 02, 2014 at 14:12 UTC | |
by LanX (Saint) on Jul 02, 2014 at 14:28 UTC | |
Re^5: Size of a HASH (with more keys)
by dorko (Prior) on Jul 02, 2014 at 16:38 UTC |