in reply to Re^2: Problem with String replace in file
in thread Problem with String replace in file
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Problem with String replace in file
by philosophia (Sexton) on Oct 22, 2007 at 18:17 UTC |