in reply to How to dynamically (yet structurally) creat a hohohohoh
There was something quite similar yesterday...
my $tree = 'Foo::Bar::Baz'; my %pkg; my $ref = \%pkg; for(split /::/,$tree){ $ref = exists $ref->{$_} ? # we don't need no autivivification ( $ref->{$_} = {} ) : $ref->{$_} } use Data::Dumper; warn Dumper(\%pkg);
Sometimes it's usefull if you've done linked lists in Pascal at school :)
--
|
|---|