3
我有一个单一的阵列ref组成的哈希引用列表。perl哈希引用运算符奇怪地工作
下面是代码:
use strict;
use warnings;
my $arrayRef = [
{
'URL' => 'http://example.com/1.jpg',
'ORD' => '1',
},
{
'URL' => 'http://example.com/2.jpg',
'ORD' => '2',
},
{
'URL' => 'http://example.com/3.jpg',
'ORD' => '3',
},
];
print $arrayRef->[0]->{URL},"\n"; # http://example.com/1.jpg
print $arrayRef->[0]{URL},"\n"; # http://example.com/1.jpg
因为它是一个哈希REF我使用->
运营商获得的价值,但我m如果不使用->
操作是精细的值相同?
perl hash ref运算符正在工作
奇怪方便 – ikegami