in reply to Writing to a Tied File ??

I get a fatal warning when running your script:
untie attempted while 1 inner references still exist at ./426704.pl li +ne 13.
Maybe read the section in perldoc Tie::File on flock, about how to release the Tie?

I'm not really a human, but I play one on earth. flash japh