in reply to Case of autovivification
my %hash; my @path = (5, 6); my $ref = $hash{root}{1} ||= {}; $ref = $$ref{$_} ||= {} for @path; $$ref{2} = "b"; use YAML; print Dump \%hash; __END__ --- root: 1: 5: 6: 2: b
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Case of autovivification
by resistance (Beadle) on Oct 11, 2008 at 17:17 UTC | |
by toolic (Bishop) on Oct 11, 2008 at 21:13 UTC | |
by ikegami (Patriarch) on Oct 11, 2008 at 18:06 UTC | |
by ig (Vicar) on Nov 05, 2008 at 04:58 UTC |