in reply to Re^2: Populating an Array of hash's
in thread Populating an Array of hash's

map +{ NAME => $_ }, LIST
is another way of writing
map { { NAME => $_ } } LIST

The expression { NAME => $_ }

  1. creates a hash,
  2. assigns NAME => $_ to it (creating a key named NAME whose associated value is $_), and
  3. returns a reference to the hash.

The expression map { { NAME => $_ } } @files

  1. For every element of @files,
    1. sets $_ to the element
    2. executes the sub-expression.
  2. A list is formed from the result of the sub-expressions and returned.

In other words,

$template->param( FILES => [ map +{ NAME => $_ }, @files ], );

could have been written

my @files_param; for (@files) { push @files_param, { NAME => $_ }; } $template->param(\@files_param);