I am new to perl. I can append a line of text to a file easily using perl, but I need to insert a line of text in the middle of the text file.
Example text file:
line 1
line 2
line 3
line 4
I need to insert a line of text after line 2.
so the output will be
line 1
line 2
new inserted line
line 3
line 4
Example text file:
line 1
line 2
line 3
line 4
I need to insert a line of text after line 2.
so the output will be
line 1
line 2
new inserted line
line 3
line 4