I set up a simple UNIVERSAL::VERSION method that allows me to search for an alternate versioned module ( e.g., one under development) instead of bailing out if the version number is too high. This works but not as cleanly as I'd like: I pull in the found module and the original. Is there any clean way to stop compilation of a given module without affecting the rest of the compile/run?
Related to this, I considered writing a true no by implementing a UNIVERSAL::unimport method that "unpollutes" the using module's namespace by removing aliased symbol table references. But it seems you can't undefine these. I tried code like this:but that gives me the error:undef *{"${caller}::{$sym}"}{CODE};
Can't modify glob elem in undef operator
I saw code in the Monastary that claimed to do it like this:But this doesn't seem correct to me -- they're undefining the function, not the symbol table reference to it, right? That seems supported by the different error I get:undef &{*{"${caller}::{$sym}"}{CODE}};
Unable to create sub named ""
A note in Advanced Perl Programming seems to indicate that you can't undo aliased symbol table names -- only use local so they revert back to their old values automagically. But I can't force a local here since the no is an optional, separate piece from the use .
Any ideas? I haven't found anything yet I can't do somehow in Perl, but this one has me stumped.
In reply to version based compilation by steves
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |