use strict; use warnings; sub pointer_to_element { use List::Util 'reduce'; reduce(sub { \($$a->{$b}) }, \shift, @_); } my @k = qw(a b c); my $href = {}; ${pointer_to_element $href, @k} = 5; use Data::Dumper; print Dumper($href);
In reply to Re: I have a hash in a hash in a .....
by Roy Johnson
in thread I have a hash in a hash in a .....
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |