in reply to Complex Hashing

You'll want references to hashes, and a loop.

use strict; use warnings; use Data::Dumper; my $hashref = {}; my $hashrefTemp = $hashref; $hashrefTemp = ($hashrefTemp->{a} ||= {}); $hashrefTemp = ($hashrefTemp->{b} ||= {}); $hashrefTemp->{e} = 'd'; print Dumper $hashref;
$VAR1 = { 'a' => { 'b' => { 'e' => 'd' } } };

Looping and I/O is left as an exercise for the reader.

Dealing with input where an endpoint coexists with a non-endpoint is also left as an exercise for the reader. (Eg: [['a','b'] ['a','b','c']])

Replies are listed 'Best First'.
Re^2: Complex Hashing
by joshpk105 (Initiate) on Oct 28, 2011 at 19:29 UTC

    I figured it out thank you.

Re^2: Complex Hashing
by joshpk105 (Initiate) on Oct 28, 2011 at 18:10 UTC

    I have no idea what this segment is doing

    $hashrefTemp->{a} ||= {}