in reply to Tainted variable

Seems like a big overhead. You should be checking you own variables for tainted'ness. From the perlfaq7:
Here's an example (which doesn't use any system calls, because the kil +l() is given no processes to signal).
Tainting occurs if you try and pass any uncontrolled information to the system interpreter. The use of kill 0 attempts to trick the perl interpreter into thinking that you are passing sensitive information (@_) to the system. If tainting fails, it will cause the script to halt execution right then and there -- so the block is wrapped in an eval block. If the data is safe, the join('',@_),kill 0; will not die and the block will return the last value of "1" signifying that the data is not tainted, this is negated with the "!" and returned as the value. If the data was tainted, the block would haved died and the eval would return undef.

That said, this might be a nice generic way to do it, but really you should be checking anything that you are passing to the interpreter yourself (using regex or other methods). This way you can already be preparing passed information for safe passage to the system level.