sub foo { my $string = ($conditional1) ? 'appended stuff' : ''; $string .= 'more appended stuff' if ($conditional2); }