my $string; if ($string) { print "A: Hello, $string.\n"; } $string = "world"; if ($string) { print "B: Hello, $string.\n"; }
B: Hello, world.