I could do the whole thing in perl as well. Part of my reluctance to do that, is I wanted to learn why coproc wasn't working, and how to make it work.
If I only use 'old skills', how will I learn anything new? Andreas Schwab wrote:
awk would be much better suited for this task. Andreas.