I was worried someone would say that
What's to worry about? If you're concerned about having to keep an extra file around, consider locking the script itself. This may not be appropriate in all cases, but it's a fairly common idiom:
use Fcntl qw(:flock); # lock myself open my $lockfh, "<", $0 or die "Cannot lock myself: $!\n"; flock $lockfh, LOCK_EX; # ... close $lockfh;
In reply to Re^3: File Locking revisited
by revdiablo
in thread File Locking revisited
by Jasper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |