given: $hash{'root'} = ['a', 'b']; $hash{'a'} = ['c']; #### I need an array that looks like this: [0] root [1] root / a [2] root / a / c [3] root / b