in reply to double hash, array, and hashed data structure

Taking almut's (++) solution one step further, you could avoid the @tempd array entirely, using either a regular hash-ref assignment (for a new segment of the hash), or a hash-slice assignment:
# Using hash-ref assignment: $tempa{a}{zeta} = {nm=>'abc', sz=>'def'}; # Using Hash slice -- @{$tempa{a}{zeta}}{qw[nm sz]} = qw[abc def]; #Resulting structure: #= { # 'a' => { # 'zeta' => { # 'sz' => 'def', # 'nm' => 'abc' # } # } # };
Data::Dumper is your friend, in viewing these structures.

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

Replies are listed 'Best First'.
Re^2: double hash, array, and hashed data structure
by Anonymous Monk on Mar 13, 2008 at 05:25 UTC
    Thanks everybody, seems so easy once I saw the examples :)
    I am sure I will keep on kicking myself on the {} instead of ().
    Reply to NetWallah:
    The reason why I have to have tempd as a intermediate is due to XML parsing order. All fields come first from the way xml:twig returns, than the record details. Don't want to copy data once it is built, so the reference is made instead.
    Regards,
    Ben