in reply to Re^3: Stashing a Package Variable by Reference
in thread Stashing a Package Variable by Reference
There is a reason why symbolic references exist in Perl, and that is to avoid having to juggle with complex manipulations like yours. Symbolic references is the simple and thus the proper approach for this kind of application.
All you have to do is to locally disable use strict (or at the very least use strict 'refs') by making a small enclosing block, and put
in there.no strict 'refs';
Even though using direct manipulation of the stashes bypasses strict, that does not imply that it's the better approach.
You just have to know when it is a proper time to break the rules.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Stashing a Package Variable by Reference
by almut (Canon) on May 31, 2010 at 22:16 UTC | |
by bart (Canon) on Jun 01, 2010 at 09:25 UTC | |
by almut (Canon) on Jun 01, 2010 at 09:42 UTC |