open (INFILE, "input.txt") or die "Can't open input.txt: $!\n"; open (OUTFILE, ">output.txt") or die "Can't open output.txt: $!\n"; while (<INFILE>) { s/foo/bar/g; print OUTFILE; }
I removed the /m and /s options from your s/// operator as they have no effect on data that doesn't contain newlines.
--"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: reading/writing line by line
by davorg
in thread reading/writing line by line
by amarceluk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |