my $x = 1;
local $y = 10;

sub f {
    $x + $y
}

sub g {
    my $x = 2;
    local $y = 20;
    f()
}

print g(), "\n";  # prints 21

# my indicates static scoping
# local indicates dynamic scoping
# stdin temporarily change the value of a global.
