$ perl -E' use Fcntl qw( LOCK_EX ); open(my $fh, "<", ".bashrc") or die; flock($fh, LOCK_EX) or die; say "ok"; ' ok