title: GetOptions Check Option Values
body: <p>I am updating an existing Perl script that uses <code>GetOptions</code> from <a href="http://perldoc.perl.org/Getopt/Long.html" rel="nofollow">Getopt::Long</a>. I want to add an option that takes a string as its parameter and can only have one of 3 values: small, medium, or large. Is there any way to make Perl throw an error or kill the script if any other string value is specified? So far I have:</p>
  
  <pre><code>my $value = 'small';
  GetOptions('size=s'  =&gt; \$value);
  </code></pre>