... my %option_to_address = ( User1 => 'user1@domain.com', # note the single quotes User2 => 'user2@domain.com', User3 => 'user3@domain.com' ); ... # take all of the values returned for m_EmailGroups and # build an address list my @addresses = map($option_to_address{$_},grep($option_to_address{$_},$query->param("m_EmailGroups"))); for my $address (@addresses) { # setup the email stuff here } ...