x = dosomething("yadda", (sometest() ? "yep" : ()), "blah");
So if sometest() returns TRUE then then we dosomething("yadda","yep","blah") otherwise we dosomething("yadda","blah").
Looking for an optional empty list element
Well that's not quite what I'm after -- I'm hoping to include two or three elements, not choose which of two values to use for the second element.
In Perl, this is simply
$x = dosomething(
(sometest() ? "yep" : ()),
Where the () signifies an empty list, so that the argument list is either a two-item "yadda","blah" or a three-item "yadda","yep","blah". (And the trailing comma is a great convenience for future cut-and-paste of lines of code.)