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;
--
meraxes
meraxes
In Section
Seekers of Perl Wisdom