title: Perl open file from command line with wildcard
body: <p>I am executing my script this way:</p>
  
  <pre><code>./script.pl -f files*
  </code></pre>
  
  <p>I looked at some other threads (like <a href="https://stackoverflow.com/questions/35471597/how-can-i-open-a-file-in-perl-using-a-wildcard-in-the-directory-name">How can I open a file in Perl using a wildcard in the directory name?</a>) </p>
  
  <p>If i hard code the file name like it is written in this thread I get my desired result. If I take it from the command line it does not.</p>
  
  <p>My options subroutine should save all the files I get this way in an array. </p>
  
  <pre><code>my @file;
  sub Options{
    my $i=0;
    foreach my $opt (@ARGV){
      switch ($opt){
        case "-f" {
          $i++;
  
          ### This part does not work:
          @file= glob $ARGV[$i];
          print Dumper("$ARGV[$i]");   #$VAR1 = 'files'; 
          print Dumper(@file);   #$VAR1 = 'files'; 
        }
      }
      $i++;
    }
  }
  </code></pre>
  
  <p>It seems the execution is interpreted in advance and the wildcard (*) is dropped in the process.</p>
  
  <p>Desired result: All files beginning with <strong>files</strong> are saved in an array, after execution from the command line.</p>
  
  <p>I hope you get my problem. If not feel free to ask.</p>
  
  <p>Thank you.</p>