in reply to storing and using LoL path

What I want to do is to store a LoL-path (HoH,AoA,HoA..) and then use it to access the real thing.
Let me give you one example (pseudo code):

%map = ( typeA => {key1}[3]{key2}, typeB => {key3}, typeC => [1]{key4}, )

Your pseudo code does not shed any light on what you may really want. Indeed it's so far from current perl syntax that it's hard to to say what you mean. In particular on the rhs of => you have something that looks like chained subscripting/dereferencing. But that doesn't make sense in a definition.

and then depending on the type I want to access different element of the LoL. i.e. again pseudo code

$lol->{$map{typeA}} <==> $lol->{key1}[3]{key2} $lol->{$map{typeB}} <==> $lol->{key3} $lol->{$map{typeB}} <==> $lol->[1]{key4}

I now have a very vague idea of what you may want and although probably it's not exactly what you mean, you may be interested in tye's Data::Diver.