There are no hash arrays in Perl, only scalar arrays. It happens that there is a bunch of syntactic sugar if these scalars are references to arrays or hashes.
In your example, $ VAR1 contains a hash reference containing a reference to an array containing hash references. Yes, this is quite a bit of nesting. In addition, an external hash seems useless since it contains only one value. So yes, I think that giving a meaningful name to the inner array will certainly make things clearer. This is actually not a “copy”: only the link is copied, not the content. All of the following equivalents:
my @files = $VAR1 -> {file}
Note that when using the sigil {ref} syntax, the sigil obeys the same rules as usual: %{$ref} (or %$ref ) is the hash referenced by $ ref, but the %{$ref} element for this key - ${$ref}{key} (or $$ref{key} ). The brackets can contain arbitrary code that returns the link, while the short version can be used only when the scalar variable already contains the link.
When your array of hash references is in a variable, iterating over it is as simple as:
for (@files) { my %file = %$_;
See: http://perldoc.perl.org/perlref.html
Grimy source share