TASdvlper has asked for the wisdom of the Perl Monks concerning the following question:
There is probably no way to do this, but I'll throw this question out there anyway. Is there any way to initialize a hash table so every 'key' (single or multi) is set to 0 ?
Basically, I'm parsing a database and I'm building a hash table with items I find in the database. I do not know what keys may be in the database ahead of time. Everything is working fine, but when I print out the hash table, some values are blank because no values matched (it's a multi-key hash table).
I hope this is clear, if not I'll try to explain better. Again, I'm guessing this is not possible just because I don't know the values of the keys ahead of time.
As always, thank in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Initializing a hash table
by thelenm (Vicar) on Jan 19, 2004 at 21:53 UTC | |
Re: Initializing a hash table
by pg (Canon) on Jan 19, 2004 at 22:08 UTC | |
Re: Initializing a hash table
by grinder (Bishop) on Jan 19, 2004 at 22:02 UTC | |
Re: Initializing a hash table
by jweed (Chaplain) on Jan 19, 2004 at 22:04 UTC |