http://www.perlmonks.org?node_id=617881


in reply to [Perl 6] Any provision for a "dereferencing object"?

Interesting question. I don't know if there's any special construct in perl 6 to do this, but it's not THAT difficult to do something similar in perl 5:
#!/usr/bin/perl -w use strict; my %a; $a{foo}[1]{bar}{baz}[3] = "bla"; my $path = sub :lvalue { $_[0]->{foo}[1]{bar}{baz}[3] }; print $path->(\%a),"\n"; $path->(\%a) = "bar"; print $path->(\%a),"\n";
And you could extend this technique using closures to make the path dynamic.