Disable warnings in the eval
#!/usr/bin/perl -w use strict; use warnings; use 5.010; use Fcntl qw/ O_WRONLY O_CREAT LOCK_EX LOCK_NB /; my $result = sysopen my $handle, "abc", O_WRONLY | O_CREAT; close $handle; eval { no warnings; $result = flock $handle, LOCK_EX | LOCK_NB }; if ($@) { say "------$@------"; } say "Done: ", $result ? "Success" : "Failed";
Good Day,
Dean
In reply to Re: A flock question
by duelafn
in thread A flock question
by AlexFromNJ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |