匿名数组和数组引用的值得访问,要用@$ 取消引用

 

代码:

  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

posted @ 2019-06-24 10:53  jimy1  阅读(176)  评论(0编辑  收藏  举报
Total Visits
AmazingCounters.com