This could work easily if there were a non-scoping (read: unhygienic) version of eval. Then it would be just a
if ($foo) { unhygienic_eval "package $foo"; sub bar { 23 } }
But I have no experience with the perl guts and expect this to be much more work than it looks like.
In reply to Re: Dynamically Changing Your Namespace
by phaylon
in thread Dynamically Changing Your Namespace
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |