From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

use strict;
use File::Temp 'tempdir';
my $tmpdir = tempdir( CLEANUP => 1 );
my $tmpfile = File::Spec->catfile( $tmpdir, 'test.lock' );
do {
my $lock = ExclusiveLock::Guard->new($tmpfile);
ok($lock->is_locked);
ok( -f $tmpfile );
};
ok( not -f $tmpfile );
done_testing;