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


in reply to Edit huge file

First thing that pops into mind for me if you really want to avoid reading/re-writing entire file:

Disclaimer: I have limited experience with Tie::File, so not sure how it performs w/ larger files.