in reply to Scalar joining, concatenation, involving varying text
Modifiers may well be what you want:
$combined .= "a=$a " if $a; $combined .= "b=$b " if $b; $combined .= "c=$c " if $c; [download]
Concise and clear.