title: Creating different arrays through loops
body: <p>Is it possible to create different named arrays while looping in Perl? What I need to do is open some files from <code>@ARGV</code> and put their data in separate arrays in one loop, for example: <code>1.txt</code> in <code>@first_array</code>, <code>2.txt</code> in <code>@second_array</code> and etc. Is it possible and if yes, what would be the best approach?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I think I'm getting closer, since <code>Data::Dumper</code> shows a correct structure of what I need, but it doesn't show the values of the files, instead, it shows this: </p>
  
  <pre><code>$VAR1 = {
        'skai.txt' =&gt; [
                        \*{'::$fh'},
                        $VAR1-&gt;{'skai.txt'}[0],
                        $VAR1-&gt;{'skai.txt'}[0],
                        $VAR1-&gt;{'skai.txt'}[0]
                      ],
        'numb.txt' =&gt; [
                        \*{'::$fh'},
                        $VAR1-&gt;{'numb.txt'}[0],
                        $VAR1-&gt;{'numb.txt'}[0],
                        $VAR1-&gt;{'numb.txt'}[0]
                      ]
      };
  </code></pre>
  
  <p>Each file consists of 4 numbers. My code looks like this:</p>
  
  <pre><code>use strict;
  use warnings;
  use Data::Dumper;
  
  my $data = {};
  
  foreach my $arg(@ARGV){
      if(open(my $fh, $arg)){
          $data-&gt;{$arg}=[];
          while(&lt;$fh&gt;){
              chomp;
              push @{$data-&gt;{$arg}}, $fh;
          }
      close($fh);
      }
  }
  
  print Dumper $data;
  </code></pre>
  
  <p>What is the meaning of <code>\*{'::$fh'}</code>?</p>