perl hash ref operator is working weirdly

hash, perl

Solution

It's valid, a kind of syntactic sugar, and it refers to the same item. The Perl references tutorial writes about this

Problem

I m having a single array ref consisting a list of hash refs. Here is the code: ``` 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 ``` Since it is an hash ref i am using `->` operator to get a value, but i m getting the same value without using the `->` operator is it fine?

Original source