IMHO
Some time ago , I was using perl system command to execute shell commands , something similar to what you are doing, grep and awk, i found out that I can do that much more efficiently and faster using perl itself -regex rather than spawning subprocesses .
Sharad