OK. fine now i am able to write in a temp. file after this now i want to overwrite the contents of original file with the contents of temp. file. why i want the original file because i want to use this original file with changes in temp. file in my further build steps
please advice Regards Irf ________________________________ From: Thomas Bätzler <[email protected]> To: [email protected] Cc: Irfan Sayed <[email protected]> Sent: Wednesday, June 17, 2009 5:38:45 PM Subject: AW: file handle in perl Irfan Sayed <[email protected]> asked: > i am still not able to modify existing lines in the existing file. > here is my code > plz help It doesn't work that way. Once you open the file for writing, it's truncated and you can't read the old contents from it anymore. Why don't you use a temporary new file for the output? Once your transformation is complete, you would then remove the old file and move the temporary file into its place. HTH, Thomas
