in reply to Appending to a file.

Take a look at the following options:

Tie::File, which lets you treat a file just like an array.

perlvar on $^I for how to make Perl edit a file in-place.

Replies are listed 'Best First'.
Re^2: Appending to a file.
by xavierarmadillo (Initiate) on May 07, 2012 at 16:00 UTC
    Reading about the tie:file makes some sense. It looks like the array addresses the memory location of the file and it works the same as an array. I don't have any clue what push, new recs...., pop, unshift, shift, or splice do.

      Mitigating cluelessness.
      That's what Perl's documentation is there for.

      • push
      • "new recs"? Perhaps you'd better re-read what puzzled you in the first place so you can quote it accurately.
      • pop
      • unshift
      • shift
      • ...and for splice... try Super Search with splice as your argument... or read a primer such as "Learning Perl."