unless you can bend the implementation to use one of the "tie" methods to handle the file read/write for you, you'll otherwise need to regenerate the whole new file each time you want to modify it...with cocurrency locking to be handled yourself also.
the hardest line to type correctly is: stty erase ^H