Although you all are trying, I'm still not getting it -- namely, how to use
the hash names in a HoH.
My reference shows the following template for a HoH:

            outermost hash
            |     inner level of hashes
            |     |             innermost key/value pairs
            |     |             |
           \/     \/            \/
        %hash = (
                fruits => {
                          favorite => "apples",
                          'second favorite' => "apples",
                          },
                vegetables => {
                          favorite => "corn",
                          'second favorite' => "peas",
                          'least favorite' => "turnip",
                          },
                meats => {
                         favorite = > "chicken",
                         'second favorite' => "beef",
                         },
                );

The outermost %h:
I wish to use "%hash" as my database file "data.db" which will tied to a
"%hashhandle" pointing to %hash when called by my script.

The next level of %h's:
It looks like "fruits", "vegetables", and "meats" in the template are hashes
that can be appended each time the outer hash is called by a script -- if,
in fact, appending occurs sequentially inside of the final ");". At least
that is what I want to do; append an inner hash each time the script is run.
However, I need the names of these inner hashes to change from run to run
(i.e., to go from fruits to vegetables, then to meats, etc.). Actually
"fruits", "vegetables", and "meats" are keys of the associated values which
happen to be another set of key/value pairs.

The innermost level of key/value pairs will, in my case, have the same four
or five key names for each inner level hash. The template shows that they
can vary in number and titles.

In my case, "fruits" represents (to me) the name of a set of key/value pairs
appended to %hash on its first call.
"vegetables" represents the name of the second set of key/value pairs
appended to %hash on its second call. Each time the database hash is called
a hash is appended. In thhis template, its name seems to be known a priori.
My script will need to generate a name for this level of hashes on each run
of the script.

It occured to me to use the time/date of each call to the script as a name
for the associated inner-hash that will be generated and then appended. But,
I understand (somewhat unclearly) that this is not allowed.

Where am I off base in my understanding of HoH's?

Ed

PS: Why is the name favorite not quoted, 'favorite', as is 'second favorite'
in the template?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to