my $outer = 1; # lexical file scope { my $inner = 1; # here I can see both $inner and $outer # as $outer is "inherited" from the outer # lexical scope { my $inner = 2; # this $inner is completely different $inner # than the $inner in the direct outer scope # but still I can see $outer } # now I can see $inner that is equal to 1 } # now I can see only $outer