# S.Chudley (www.chudley.me) : Lock a file use Fcntl qw (:flock); my $file = $ARGV[0]; if (! -f $file) { print "Can't find '$file'\n"; exit(1); } open(FILE, ">>$file"); flock(FILE, 2); print "Type something and hit enter to unlock: "; ; close(FILE);