Trapping all exits from perl may indeed make your code too complex.
I like pc88mxer's idea above of controlling your test environment with a VM or chroot solution. This way you can "mock" the expected, root owned external commands as you see fit w/o touching your perl code.
In reply to Re^3: mocking or trapping system calls
by Anonymous Monk
in thread mocking or trapping system calls
by wu-lee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |