title: In my Perl CGI script, how can I access the checked values in a checkbox group?
body: <p>I have a form with several input methods. I pass that data to a perl script to process print out text based on the data input. I am having a problem with the values of a checkbox group. (checkboxes all with the same name) </p>
  
  <pre><code>&lt;td&gt;Profiles: &lt;/td&gt;
   &lt;td&gt;&lt;input type=\"checkbox\" value=\"oneconnect\" name=\profile[]\"&gt;OneConnect &lt;br /&gt;
   &lt;input type=\"checkbox\" value=\"http\" name=\profile[]\"&gt;HTTP &lt;br /&gt;
   &lt;input type=\"checkbox\" value=\"xforwardedfor\" name=\profile[]\"&gt;Xforwarded-for&lt;/td&gt;
   &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p>The action sends this data to a perl script for processing.</p>
  
  <pre><code>read (STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
  @pairs = split(/&amp;/, $FormData);
  print Dumper($FormData);
  
  foreach my $pair (@pairs) {
  # Separate the name and value:
  ($name, $value) = split(/=/, $pair);
  # Convert + signs to spaces:
  $value =~ tr/+/ /;
  # Convert hex pairs (%HH) to ASCII characters:
  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  # Store values in a hash called %FORM:
  $FORM{$name} = $value;
  }
  </code></pre>
  
  <p>I can then print most of the data the with:</p>
  
  <pre><code>print "$FORM{'vsip1'}  $FORM{'vsport1'} &lt;br /&gt;\n";
  </code></pre>
  
  <p>However, I cannot access the name "profile" from the checkboxes with the same print command. I do see the "profile" values when I "dump" the data.
  print dumper output shows (&amp;%5Cprofile%5B0%5D%22=oneconnect&amp;%5Cprofile%5B1%5D%22=http&amp;SubmitForm) Is this a hash of a hash? and how can I access these values in perl.</p>
  
  <p>Thank you for any suggestions you can provide.</p>