use Fcntl ':flock'; # ... code ... open FH, ">>$file" or die "Can't open $file: $!"; flock FH, LOCK_EX; # lock it # ... print() to file here flock FH, LOCK_UN; # not really necessary since close() # will unlock the file anyway close FH; # ... code ...
In reply to Re: (OT?) File Locking
by perlplexer
in thread (OT?) File Locking
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |