匿名hash

[root@oadb test]# cat a1.pl 
use Data::Dumper;
my @a=qw/1 3 5 7 9/;
push @b ,{@a};
print Dumper(@b);
print "\n";


print $b[0]->{1};
print "\n";
[root@oadb test]# perl a1.pl 
$VAR1 = {
          '1' => '3',
          '9' => undef,
          '5' => '7'
        };


3

匿名hash  把hash引用塞入到数组,作为数组的第一个元素





   
posted @ 2016-11-19 18:07  czcb  阅读(119)  评论(0编辑  收藏  举报