title: "Too many arguments" when passing an array to Perl sub?
body: <p>I have a function below in perl</p>
  
  <pre><code>sub create_hash()
  {
  my @files = @_;
  
          foreach(@files){
           if(/.text/)
           {
  
           open($files_list{$_},"&gt;&gt;$_") || die("This file will not open!");
  
           }
        }
  
  }
  </code></pre>
  
  <p>I am calling this function by passing an array argument like below:</p>
  
  <pre><code>create_hash( @files2);
  </code></pre>
  
  <p>The array has got around 38 values in it.
  But i am getting compilation errors:</p>
  
  <pre><code>Too many arguments for main::create_hash at ....
  </code></pre>
  
  <p>what is the wrong that i am doing here?</p>
  
  <p>my perl version is :</p>
  
  <pre><code>This is perl, v5.8.4 built for i86pc-solaris-64int
  (with 36 registered patches, see perl -V for more detail)
  </code></pre>