Welcome to the Monastery | |
PerlMonks |
Re^3: Passing file handle to tee that goes into openby johngg (Canon) |
on Nov 10, 2016 at 11:11 UTC ( [id://1175668]=note: print w/replies, xml ) | Need Help?? |
If you have written to an open file handle in a Perl script the file pointer is at the end of the file. If you then append something to that file using an external program the file pointer in the Perl script is not updated and any subsequent writes in the script will overwrite the externally written data. Doing a seek to end of file in the script after the external program has completed should update the file pointer so that subsequent writes by the script continue after the external data. There may be better ways to write both internal and external data to the same file but I have used this technique without problems. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|