in reply to recursively building a hash of arrays of scalars
As you can see, assigning 42 to $$destref does the trick. But is this what you are trying to do? Hum, probably not, because you have here one extra level of indirection that you probably don't want.DB<1> %testHash =(); DB<2> $hashRef = \%testHash; DB<3> $destref = \${$hashRef->{'a'}}; DB<4> x \%testHash; 0 HASH(0x302ee0c8) 'a' => SCALAR(0x302ee218) -> undef DB<5> $$destref = 42; DB<6> x \%testHash; 0 HASH(0x302ee0c8) 'a' => SCALAR(0x302ee218) -> 42
So, maybe, you rather want something like this:
My gut feeling (if I understood correctly) is that this is more probably what you are trying to do.DB<1> %testHash =(); DB<2> $destref = \$testHash{'a'} DB<3> x \%testHash; 0 HASH(0x302ee0c8) 'a' => undef DB<4> $$destref = 42; DB<5> x \%testHash; 0 HASH(0x302ee0c8) 'a' => 42
|
|---|