# create an array whose keys all have values 'no' my %checkbox = map { $_ => 'no' } keys %label; # update each found key's value to 'yes' $checkbox{$_} = 'yes' for param('checkbox');