匿名数组和数组引用的值得访问,要用@$ 取消引用
代码:
5 my $aref= [ 1,"foo",undef,13 ];
6 print @$aref[0]."\n";
7 print @$aref[1]."\n";
8 print @$aref[3]."\n";
输出:
1
foo
13
代码:
5 my $aref= [ 1,"foo",undef,13 ];
6 print @$aref[0]."\n";
7 print @$aref[1]."\n";
8 print @$aref[3]."\n";
输出:
1
foo
13