Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有如下哈希:
my @A=( 1,2,[[ 1,2 ],[ 3,4,5 ]], [ 6,7,8 ]);
如何在上面数组的第三个元素中插入一个数组?这里的第三个元素是一个数组数组,我想插入一个数组 [9,10]。
怎么能做到这一点?
使用push和取消引用 ( @{...}):
push
@{...}
push @{ $A[2] }, [9, 10];
请注意,不涉及“哈希”。