title: Not able to restrict the number of arguments for an option with GetOptions in Getopt::Long
body: <p>My program is as follows:</p>
  
  <pre><code>   use strict;
     use warnings;
  
     use Getopt::Long;
  
     my @letters;
     my @words;
  
     GetOptions(
        "letters=s{2}" =&gt; \@letters,
        "words=s{,}" =&gt; \@words
     );
  
     print "Letters: " . join(", ", @letters) . "\n";
     print "Words: " . join(", ", @words) . "\n";
  </code></pre>
  
  <p>When I run this program I get the output as follows:</p>
  
  <pre><code>   perl getopts.pl --letters a --words he she it
     Letters: a, --words
     Words:
  </code></pre>
  
  <p><code>--words</code> is read as part of <code>--letters</code> arguments itself. I expect <code>GetOptions</code> to throw error message in this scenario. How to get this done.</p>