in reply to Re^4: Stashing a Package Variable by Reference
in thread Stashing a Package Variable by Reference
... which isn't a symbolic reference??
Yes, but it's not any safer than symbolic reference. Given that symbolic references are easier to use, you might as well use those instead of messing with %::.
Compare
withmy $r = do { no strict 'refs'; \${"${pkg}::$var"} };
my $r = do { $pkg_ref = $r->{$_."::"} for split(/::/, $pkg); \($pkg_ref->{$var}) };
|
|---|