Thank you for the very clear explanation. It looks to me that Perl is a bit over-kill here and that a simple shell-script could do the job much easier.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
Comment on Re^5: System Function...script does not move until process ends.