http://qs321.pair.com?node_id=1103787

PackerX has asked for the wisdom of the Perl Monks concerning the following question:

I have a file that I would like to update, line by line. This is what I'm attempting, which is not working.
open(DATA, "+<myfile.csv") || die "Error: $!"; while(<DATA>) { s/foo/bar/g; # print; } close(DATA);
If I uncomment #print, the output gives me exactly what I expect, but the file is not updating. What am I missing here? I need to update the file line by line because the file may be extremely large and I do not want to pull the whole thing into memory.