RollyGuy has asked for the wisdom of the Perl Monks concerning the following question:
At work I need to edit a file to add a comment character on some lines and also replace some multi-line strings with others. My first take is to slurp all of the lines of the file into an array, edit the lines one by one, and then write out the array back to the file. It seems to me that there should be a way to edit the file in place. So, how it that done?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Edit File in place
by tommyw (Hermit) on Aug 13, 2002 at 11:41 UTC | |
Re: Edit File in place
by vroom (His Eminence) on Aug 13, 2002 at 13:56 UTC | |
Re: Edit File in place
by Bird (Pilgrim) on Aug 13, 2002 at 14:31 UTC | |
by spurperl (Priest) on Aug 14, 2002 at 06:13 UTC | |
by Bird (Pilgrim) on Aug 15, 2002 at 18:58 UTC | |
Re: Edit File in place
by spurperl (Priest) on Aug 13, 2002 at 13:23 UTC | |
by RollyGuy (Chaplain) on Aug 13, 2002 at 14:12 UTC | |
Re: Edit File in place
by rinceWind (Monsignor) on Aug 14, 2002 at 10:36 UTC |
Back to
Seekers of Perl Wisdom