Could you stash the actual CORE::exit coderef somewhere and try overriding CORE::GLOBAL::exit? Or simply import an exit sub into the module's namespace, which will override exit in that namespace only. (You may need to establish this import before loading the module; I am uncertain about this.)
To test pod2usage in that, you will probably need to place your own exit mock at Pod::Usage::exit, and it should probably use a non-local exit, such as die or last, instead of returning normally.
In reply to Re: Portably unit testing scripts
by jcb
in thread Portably unit testing scripts
by wanna_code_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |