in reply to How do I add a few stings of text, 30 lines before the EOF?

Why don't you want to read it all and then insert the lines?
splice can be used to do the interpolation.
use strict; open FILE, "fichero.txt"; my @lines = <FILE>; close FILE; my @newlines = ("First\n", "Second\n"); splice @lines,-30,0,@newlines; print @lines;

Hopes

Replies are listed 'Best First'.
Re: Re: How do I add a few stings of text, 30 lines before the EOF?
by lucasdmc (Initiate) on Oct 16, 2001 at 03:31 UTC
    Because I am looking for a more efficient method of doing this.