how to access variables in imported module in local scope in perl?
问题 I am stuck while creating a perl Moose module. I have a global pm module. package XYZ; require Exporter; our @ISA = qw(Exporter); ## EDIT missed this line our @EXPORT_OK = qw($VAR); my $VAR1 = 1; our $VAR = {'XYZ' => $VAR1}; 1; I want to get $VAR in a Moose module I'm creating package THIS; use Moose; use YAML::XS; sub get_all_blocks{ my ($self) = @_; require $self->get_pkg(); # this returns the full path+name of the above package # i cannot use use lib+use since the get_pkg starts