in reply to Re: Replace first blank line in a text file with headers.
in thread Replace first blank line in a text file with headers.
The Tie::File module is a solution, a one-liner using in-line option is another. Else, opening another file for writing, making the necessary changes, and renaming the files is another option.
Then only should we worry about avoiding to change other lines, one way or another.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Replace first blank line in a text file with headers.
by Marshall (Canon) on Mar 24, 2016 at 23:04 UTC | |
|
Re^3: Replace first blank line in a text file with headers.
by ExReg (Priest) on Mar 24, 2016 at 19:52 UTC | |
by rementis (Beadle) on Mar 24, 2016 at 21:22 UTC |