in reply to in search of a more elegant if then else

The Conditional Operator is another way. You should decide, on a case-by-case basis, if it is better than an if/else.
my $var = (condition) ? value1 : value2;