in reply to Variable scope in ternary ?: operator not propagating?
If you never use $bar again, then I might do:
my $foo= do { my $bar= localtime; $bar ? "$bar hello" : "FAILED!"; }; [download]