title: Checkboxes with Perl CGI
body: <p>Sorry if my question is too simple, I am just starting out with CGI...
  So I have a bunch of checkboxes with the same name. Sample HTML:</p>
  
  <pre><code>&lt;form action="/cgi-bin/checkbox.cgi" method="POST"&gt;
  &lt;input name="Loc_opt" value="Loc_1" type="checkbox"&gt;Option 1&lt;br&gt;
  &lt;input name="Loc_opt" value="Loc_2" type="checkbox"&gt;Option 2&lt;br&gt;
  &lt;input name="Loc_opt" value="Loc_3" type="checkbox"&gt;Option 3&lt;br&gt;
  &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I need to find out which of them are checked using Perl CGI. I have the following in checkbox.cgi:</p>
  
  <pre><code>print "Content-type:text/html\r\n\r\n";
  local ($buffer, @pairs, $pair, $name, $value, %FORM);
      # Read in text
      $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
      if ($ENV{'REQUEST_METHOD'} eq "POST")
      {
      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
      }else {
      $buffer = $ENV{'QUERY_STRING'};
      }
      # Split information into name/value pairs
      @pairs = split(/&amp;/, $buffer);
      foreach $pair (@pairs)
      {
      ($name, $value) = split(/=/, $pair);
      $value =~ tr/+/ /;
      $value =~ s/%(..)/pack("C", hex($1))/eg;
      $FORM{$name} = $value;
      }
  </code></pre>
  
  <p>What should I do to now print, say, the values of the selected checkboxes?</p>