Re: in place edit.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Quoted text here. Click to load it

Something like this.. where you adapt it to create a new file.

use strict;
use warnings;

my $line_to_insert = "insert\n";
my $last;
open DATA, '<data.txt' or die "can't open data.txt: $!";

      while (<DATA>) {
        $last = tell(DATA) if /<\/tr>/;
      if (defined $last) {
         seek DATA,0,0;
         while (<DATA>) {
             print $line_to_insert if tell(DATA) == $last;
close DATA;



Site Timeline