IMHO is
$a = \$h{"a"}; print $$a; $$a = "xxx\n"; $a = $h{"a"}; print $a;
the same as:
new P1, .PerlHash set P0, P1["a"] print P0 set P0, "xxx\n" set P2, P1["a"] print P2 end
(PMCs have reference semantics[1])
Shouldn't that print "xxx" as perl5 does? I.e. store the returned PerlUndef in the hash. And PerlArray too.
Isn't that the job of Perl's \ operator?
perl <<'EOT'
my %hash = ();
my $temp = $hash{key};
print 'after $temp = $hash{key}: ', exists $hash{key}? "exists\n" : "does not exist\n";
$temp = \$hash{key};
print 'after $temp = \$hash{key}: ', exists $hash{key}? "exists\n" : "does not exist\n";
EOT
Or, better, Perl's lvalue context...
—
Gordon Henriksen [EMAIL PROTECTED]