The CORE documentation has shown me how to merrily mock various built Perl functions. However, I\'m not really sure how to replace \'-d\' &c. with my methods. So this is
CORE::GLOBAL doesn't work on things without prototypes. The only way I can think to do it is rewrite the opcode tree... which is not for the faint of heart. You could pull it off with a combination of B::Utils and B::Generate and a lot of experimentation.
Simplest thing to do would be to use File::Temp to make a temporary directory structure to your liking.