In a cgi task, I've got a select box that a user can choose multiple options in. I'm having some difficulty with the perl and parsing the multiple options. So here's my select box, and I have to use a select box too:
<select name="groupemailto" multiple>
<option value="ACSCIS">ACS CIC</option>
<option value="ACSCSG">ACS CSG</option>
<option value="ACSLEGAL">ACS
<option value="DCH">DCH</option>
<option value="OMNI">Omni</option>
</select>
If a user selects two or more options, it looks like the key -value pair for the groupemailto item is an array. When I print it out it's:
name: groupemailto
value: ARRAY(0x34f490)
Now I've tried the following code to parse through the array but have not gotten it to work.
use TeamSite::CGI_lite;
my ($cgi) = new TeamSite::CGI_lite->new();
$cgi->parse_data();
my
@groupemailto = $cgi->{form}{groupemailto};
foreach $newemail (
@groupemailto){
print "Group address: $newemail\n";
}
And all I get for output is:
Group address: ARRAY(0x34f490)
So what am I missing here? Can CGI::Lite handle a multiple select box?
Any and all help is most appreciated. Thanks!