print start_table({-border => '', -width => "100%"}),
(
$foo ?
Tr(td('foo is set'), td('foo is still set')) :
Tr(td('foo is not set'), td('foo is still not set'))
), end_table;
That works. (I initially tried putting a bare block inside the print statement, but it looks like perl saw it as an anonymous hash, instead.) Or you can just put your conditional outside of any print statements:
print start_table({-border => '', -width => "100%"});
if ($foo) {
print Tr(td('foo is set'), td('foo is set, still'));
} else {
print Tr(td('foo is not set'), td('foo is not set, yet'));
}
print end_table;