in reply to
Auto flock
Using File::Util will do this for you automatically.
use File::Util;
my $ftl = File::Util->new();
# write to a file: (It is automatically locked)
$ftl->write_file(file => '/foo/bar/baz.txt', content => 'blah blah bla
+h');
# read from a file: (It is automatically locked)
my $content = $ftl->load_file("/foo/bar/baz.txt");
# to get an open filehandle that is automatically locked,
# see http://search.cpan.org/~tommy/File-Util-3.30_003/Util.pod#open_h
+andle
--
Tommy
$ perl -MMIME::Base64 -e 'print decode_base64 "YWNlQHRvbW15YnV0bGVyLm1lCg=="'