Next Tie::File 7

How do I insert a line in the middle of a file?

        for my $n (0 .. $#LINE) {
          if ($LINE[$n] =~ /<!--insert here-->/) {
            splice @LINE, $n+1, 0, $new_html_text;
            last;
          }
        }
        untie @LINE;        


Next . Copyright © 2002 M. J. Dominus