cghost23 has asked for the wisdom of the Perl Monks concerning the following question:
the program i am working on is designed to open a file, read one line at a time..perform some substitutions and write the changed line back to disk. what would be the best way to do this? opening the file, and using a while loop to change one line at a time and then print it back to the filehandle...but how do you make one line replace another in the original file? or would opening a second empty file and printing the new lines to that make more sense? sorry for being so vague...any help would be greatly appreciated.
Edited 2001-04-24 by mirod: changed the title.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: general perl question
by mirod (Canon) on Apr 24, 2001 at 14:46 UTC | |
by Rosencrantz (Initiate) on Apr 25, 2001 at 00:22 UTC | |
|
Re: general perl question
by zigster (Hermit) on Apr 24, 2001 at 14:50 UTC | |
by frankus (Priest) on Apr 24, 2001 at 15:07 UTC | |
|
Re: general perl question
by repson (Chaplain) on Apr 24, 2001 at 15:17 UTC | |
by petdance (Parson) on Apr 24, 2001 at 17:37 UTC | |
by repson (Chaplain) on Apr 25, 2001 at 07:31 UTC | |
|
Re: In-place editing of files (was: general perl question)
by LunaticLeo (Scribe) on Apr 24, 2001 at 22:11 UTC |