The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/bin/perl

use strict;
use warnings;

use Fcntl qw(:flock);

open my $fh, '>>', 'tfiles/locking-daemon' or die "Can't open lock file: $!";
flock $fh, LOCK_EX | LOCK_NB or die "lock failed";
sleep 100;