in reply to Double Hash Key

recon this should accomplish what you are asking for:
$href = \%drw; foreach ( keys %$href) { print "primaryKey = $_\n"; foreach ( keys %{$href->{$_}}) { print "\tsubKey = $_\n"; } }

However your question is a bit ambiguous, I quote “am looking how to be able to list the keys on the second hash gate do you know how I might do this. The second loop I would hope to receive "eone", "etwo", "ethree"” If you want to receive "eone", "etwo", "ethree"” these are the values of the subkeys. Which one do you want Keys or Values of subkeys? If you indeed would like the values use the below code:
$href = \%drw; foreach ( keys %$href) { print "primaryKey = $_\n"; foreach ( values %{$href->{$_}}) { print "\tsubKeyValue = $_\n"; } }

-3DBC ;-)

Replies are listed 'Best First'.
Re: Re: Double Hash Key
by Roy Johnson (Monsignor) on Jan 15, 2004 at 21:25 UTC
    Why are you taking a ref to the hash?

    The PerlMonk tr/// Advocate
      Why Not? It adds another level of data abstraction. The entire data structure can now be considered an object. Isn't a complex data structure pointer considered to be better programming style?

      Thanks,
      -3dbc
        If the data structure had methods, it could be considered an object. I don't think there's any advantage to merely operating through a reference when you can do exactly the same thing on the structure. There's nothing that says an object needs to be a reference, although that's how they are usually implemented.

        The PerlMonk tr/// Advocate