#!/tool/pandora64/bin/perl -w -I ./ use strict; use warnings; use v; # variables/funcs work without v::, the package code is almost the same) #use w; # This makes variables/funcs work without w:: use A::w; # this requires w:: to identify the package sub_in_v(); w::sub_in_w(); $var_in_v = "v-variable"; $w::var_in_w = "w-variable"; # works only because of the w:: when use-ing A::w printf("%s\n", $var_in_v); printf("%s\n", $w::var_in_w); # works only because of the w:: when use-ing A::w print(join("\n", @INC)); 1; #### package w; # in ./A use Data::Dumper; use Exporter; our $var_in_w; our @EXPORT= ('$var_in_w', 'sub_in_w'); our @ISA = qw(Exporter); sub sub_in_w{ print("this is from a sub in package SRAM::w!\n"); } BEGIN{ print('this is w\'s BEGIN, @ISA = ', Dumper @ISA, "\n"); 1; } END{ print("w ending now.\n"); } 1;