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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Auto flock
by space_monk (Chaplain) on Nov 20, 2012 at 02:46 UTC |