http://www.perlmonks.org?node_id=693834


in reply to Problem with larger files (and s/)

open(IN, $sqlfile) || die "cannot open $sqlfile for input: $!"; open(OUT, ">$outfile") || die "cannot open $outfile for output: $!";

If you are sure that the files are all ASCII, try this instead:

open(IN, '<:encoding(ASCII)', $sqlfile) or die "cannot open $sqlfile f +or input: $!"; open(OUT, '>:encoding(ASCII)', $outfile or die "cannot open file $outf +ile for writing: $!";

Are you really sure that the files are in ASCII? which editor did you open it with? Try to inspect the files with a hex editor/dumper and see if it's really ASCII.