On 11/09/2009 05:24 AM, Ovid wrote:
Thinking about this more, what about a compile_ok()? It merely asserts that the code compiles (in an anonymous namespace, perhaps?), but doesn't make any guarantees about you being able to even use the code -- just that it compiles. It wouldn't need to be done at BEGIN time, nor would it necessarily require a "or die" after it, since its availability is not guaranteed (though that would be problematic as cleaning a namespace is also fragile).
Cleaning up a module's existing namespace is pretty impossible in Perl. Especially if you think about packages that when loaded affect multiple namespaces. If this is done, it should probably be done in a separate Perl process (fork) that replicates the current environment.
-- Michael Peters Plus Three, LP