open(TEST, ">test.html") or die "Cannot open test.html for writing: $!\n"; flock TEST, 2; print TEST "Whatever you want to say"; close(TEST);