in reply to Multiple HTML field names
That said, you can tackle this one by doing one substitution that puts in both:
$main_template =~ s/%%keywords%%/$fields{'keywords'} $fields2{'search' +}/g; [download]