package A; package B; { our $d = 1; } package C; package D; # now you have to use the package name to access the var print $B::d;