I suspect your problem is that you are writing back to the filehandle IN when you (presumably) only opened it for read.
open( IN, '<', $filename ); # input open( OUT, '>', 'newfilename.txt' ); # output while ( <IN> ) { s/\|\|/|\\N|/g; print OUT; } close IN; close OUT;
In reply to Re^3: Problem with String replace in file
by meraxes
in thread Problem with String replace in file
by philosophia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |