David92 has asked for the wisdom of the Perl Monks concerning the following question:
I seek for your wisdom. I have been stucked with a problem with Hashes.
I have a hash, for example: testHash{$year}{$status} = ..some value..
There are many different statuses that I have (it is not a fix number). The number changes when I refresh the PERL script, which fetches the data from database.I am writting a File with PERL, and it requires that I have to delete the last character (",") in my file. But before, I need the "," in my file at the end of each sentence.
So Id like to get the size of the hash second Key, not the first one (I know how to do that one). When I have the size, I can loop around until I reach the last key and then delete the "," from the last sentence in my generated file.Can anyone help me please?
BR, David
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Size of a HASH (with more keys)
by choroba (Cardinal) on Jul 02, 2014 at 12:02 UTC | |
by David92 (Sexton) on Jul 02, 2014 at 12:30 UTC | |
Re: Size of a HASH (with more keys)
by perlfan (Parson) on Jul 02, 2014 at 12:08 UTC | |
by David92 (Sexton) on Jul 02, 2014 at 12:20 UTC | |
by LanX (Saint) on Jul 02, 2014 at 12:49 UTC | |
by David92 (Sexton) on Jul 02, 2014 at 12:59 UTC | |
by Corion (Patriarch) on Jul 02, 2014 at 13:02 UTC | |
by AnomalousMonk (Archbishop) on Jul 02, 2014 at 13:29 UTC | |
by LanX (Saint) on Jul 02, 2014 at 13:08 UTC | |
| |
by dorko (Prior) on Jul 02, 2014 at 16:38 UTC |