title: Getopt::Long missing parameters
body: <p>I wrote a script that needs to get few arguments from the user, and I encountered a problem while trying to read my script arguments.</p>
  
  <p>The script can get the <code>-type</code> for running the functions on one file type or can get the flag <code>-all</code> in order to run on all file types.</p>
  
  <pre><code>my $opt = GetOptions (
      'help|h' =&gt; \$help,
      'type=s' =&gt; \$type,
      'all'    =&gt; \$all,
  );
  </code></pre>
  
  <p>I am trying to think about all the wrong options that a user can run and found that when the user is running <code>myscript.pl -type -all</code>, the module reads the <code>-all</code> as the <code>-type</code> string.</p>
  
  <p>Is there any elegant way to avoid such a thing?</p>