sub foo { my $x = 123; bar(); } sub bar { # bar cannot access variable $x } foo();