use strict; my $foo = 1; { my $bar = do { if ($foo) { "true"; } }; print $bar; }