- or download this
use warnings;
use strict;
- or download this
chomp($pid = $$);
- or download this
$LOCK_EXCLUSIVE = 2;
$UNLOCK = 8;
- or download this
use Fcntl ':flock';
- or download this
$fifo = "ENV{HOME}/a_file";
- or download this
$fifo = "$ENV{HOME}/a_file";
- or download this
close(FILE) || warn "update queue file exited $?\n";
- or download this
close(LOCK) || warn "lock file exited $?\n";;
$str=`cat $fifo.lock`;
flock LOCK, $UNLOCK;
- or download this
system("rm $fifo.lock");
- or download this
#!/usr/local/bin/perl
use warnings;
...
__END__