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 :)
--In reply to Re: How to dynamically (yet structurally) creat a hohohohoh
by fruiture
in thread How to dynamically (yet structurally) creat a hohohohoh
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |