use CGI 'param'; # use the CGI module, and import the function named "param" $email_to = param('extra_emails'); # this assumes that your text input is called "extra_emails" #### my %checkboxes = ( ChkBoxName1 => 'EmailGroup1@Domain.com', ChkBoxName2 => 'EmailGroup2@Domain.com', ); foreach my $checkbox_name (keys %checkboxes) { $email_to .= "$checkboxes{$checkbox_name}, " if param($checkbox_name); # if the checkbox was ticked, the param call returns true, and $email_to gets the email address added. }