Linux-Sysfs

 view release on metacpan or  search on metacpan

t/common.pl  view on Meta::CPAN


package Where::The::Hell::Is::It::Documented::That::I::Can't::Export::Symbols::To::main::From::main::Questionmark;
# After trying to use the same piece of code without the above package statement
# I concluded it was a perl bug. I digged into the perl sources and found out
# that SVs (and other variables) are only marked as being imported (and therefor
# strict clean) if CopSTASH_ne(PL_curcop, GvSTASH(dest)), where dest is the SV
# to be copied to returns true. This is the case when the current control ops
# (PL_curcop) namespace doesn't match the namespace of the destination SV..
# See sv.c line 3776 (5.8.8).

my $conf = require 't/config.pl';

my $caller = (caller())[0];
while (my ($key, $val) = each(%{ $conf })) {
    no strict 'refs';
    *{ "${caller}::${key}" } = \$val;
}

1;



( run in 0.282 second using v1.01-cache-2.11-cpan-0d8aa00de5b )