my $var = 4; my $bar; ... sub bar { $bar = 42; ..} print "bar is $bar\n"; bar($bar); boo($var); sub boo { ... } ... sub foo { ... } print "bye\n";