This syntax works:
$b{"x"} = [1,2,3];
pp %b;
# Displays ("x", [1, 2, 3])
But I need to be able to dynamically create the array's contents and assign it later. This does not work; help, what's the obvious part I'm missing?
@a = [1,2,3];
$b{"x"} = @a;
pp %b;
# Shows up as ("x", 1) ... not what I want or expected.
Tried these variations, too.
$b{"x"} = [@a]; # ("x", [[1, 2, 3]]) ...close
$b{"x"} = \@a; # ("x", [[1, 2, 3]])
$b{"x"} = [\@a]; # ("x", [[[1, 2, 3]]])
$b{"x"} = %a; # ("x", 0)
$b{"x"} = $a; # ("x", undef)
$b{"x"} = [$a]; # ("x", [undef])
$b{"x"} = @{@a}; # ("x", 0)
And, ideally, I'd like to be able to get the array back out later as an array.