AFAICT, this doesn't do what the OP wants, since it truncates the contents of $ARGV[2].
the lowliest monk
In reply to Re^2: reading/writing to a file by tlm in thread reading/writing to a file by nnp