sub init { our ($foo); $foo = 0; } sub inc { our ($foo); $foo++; # same variable, $main::foo, as in init }