in reply to file lock and update

CColin:

A minor nit in terminology: Your program doesn't modify the file in place. "Modify in place" means to open the file in read/write mode and alter the file without creating a new copy. (Not terribly safe for many applications, though!) Here's an example of modifying a file in place:

$ cat 659032.pl #!/usr/bin/perl -w use warnings; use strict; # Open in Read/Write mode and modify it in place open FH, "+<", "a_file.txt" or die "Can't open file!"; print FH "Foo bar baz!"; close FH; $ cat a_file.txt Now is the time for all good men to come to the aid of their party. $ perl 659032.pl $ cat a_file.txt Foo bar baz!ime for all good men to come to the aid of their party. $
...roboticus