my $x = $x; # Initialize with value from outer scope. #### my $x = f(); if ($x and g($x)) { ... } #### if (my $x = f()) { if (g($x)) { ... } }
## my $x = f(); if ($x and g($x)) { ... } ##
## if (my $x = f()) { if (g($x)) { ... } }