There's actually even a perl function called "rename" that does just this. Here's some good reading for you. Maybe from there you can look up other stuff when you have questions.

http://perldoc.perl.org/functions/rename.html



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Aimee Mostella Cardenas
Department of Genetics
Southwest Foundation for Biomedical Research
7620 NW Loop 410
San Antonio, TX  78245
Phone: (210) 258-9884
aim...@sfbrgenetics.org





On Jun 17, 2009, at 8:34 AM, Thomas Bätzler wrote:

Irfan Sayed <irfan_sayed2...@yahoo.com> wrote:
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

If you write both the modified and the unmodified lines to the temporary file, then the temporary file will be the file you need in your further build steps. The only problem is that it still has the wrong name. So you delete the original file and rename the temporary file to become the new original file.

HTH,
Thomas

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to