Reputation: 557
Suppose i have a hash as below:
my @A=( 1,2,[[ 1,2 ],[ 3,4,5 ]], [ 6,7,8 ]);
How do i insert an array in the third element of the array above? Third element here is an array of arrays and i want to insert an array [9,10].
how can do this?
Upvotes: 1
Views: 298
Reputation: 241758
Use push
and a dereference (@{...}
):
push @{ $A[2] }, [9, 10];
Note that there is no "hash" involved.
Upvotes: 2