> This is from Chapter 9, page 281 slighly
>changed to reflect my values:
>
>for $table ( keys %tablename) {
>    print "Table Name: $table \n";
>
>    for $items ( keys %{ $tablename{$table} } ) {
>        print "\t$items=$tablename{$table}{$items}\n ";
>
>    }
>
>    print "\n";

That looks reasonable.

> Here are the results:
>
>Table Name: TURBINE_PERMISSION
>        con_name=ARRAY(0x216de8)
>        index_name=TURBINE_PERMISSION_PK
>        con_type=ARRAY(0x216c8c)
>        columns=PERMISSION_ID
>        created_by=ARRAY(0x211a50)
>        type=NORMAL
>        rem_con_name=ARRAY(0x211b04)
>        tablespace=CTNG

It looks like some of the values in your hash are arrays.

> This is the code that created the hash of hashes.
>It was done in 2 parts:
>
> First part (initilizing):
>
>$tablename{"$table"} = {
>                "index_name"    => $index_name,
>                "columns"       => @column_name,
>                "type"          => $index_type,
>                "tablespace"    => $tablespace_name
>
>                };
>
> Adding to the hash:
>
>$tablename{$table} -> {con_name}     = [$constraint_name];
>$tablename{$table} -> {con_type}     = [$type];
>$tablename{$table} -> {rem_con_name} = [$r_constraint_name];
>$tablename{$table} -> {created_by}   = [$generated];
>
> The above is from the help (thank you) from a previous post.

Why are you wrapping these in arrays?  If you used:
$tablename{$table} -> {con_name}     = $constraint_name;
$tablename{$table} -> {con_type}     = $type;
$tablename{$table} -> {rem_con_name} = $r_constraint_name;
$tablename{$table} -> {created_by}   = $generated;

Then you would get the values in your print, instead of array indexes.

> Why am I getting the value in the first part, and the
>memory location for the second part? In other words, the key/values
>print out as expected from the initializing loop, but not from
>the "adding" part?

I hope that I answered your question above.  The other option is to test
each value to see if it is an array, and then dereference it correctly, but
I don't think that's what you are looking for.

                                /\/\ark


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

Reply via email to