Vinay Thombre <[EMAIL PROTECTED]> wrote:
[attribution inserted]
"Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]> wrote
  open INPUT, "< in.txt" or die "can't read in.txt: $!";
  open OUTPUT, "> out.txt" or die "can't write out.txt: $!";
  while (my $line = <INPUT>) {
    # do something to $line
    print OUTPUT $line;
  }
  close OUTPUT;
  close INPUT;
I want in.txt and out.txt file to be same.
That is I want to replcae text insa me file and do not want to create a
new file.

perldoc -q insert


How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?

Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to