我有一个数组@allinfogoals
,我想将其转换为多维数组。为了实现这一目标,我尝试将一个数组作为项进行推送,如下所示:
push @allinfogoals, ($tempcomponents[0], $tempcomponents[1], $singlehometeam);
在数组括号中的这些项目都是之前准备好的单独字符串。但是,如果我引用$allinfogoals[0]
,我会得到$tempcomponents[0]
的值,如果我尝试$allinfogoals[0][0]
,我会得到:
Can't use string ("val of $tempcomponents[0]") as an ARRAY ref while "strict refs" in use
如何将这些数组添加到@allinfogoals
中,使其成为一个多维数组?