in reply to Locking memory region

Can you? yes. How should you? Or even, should you? Impossible to tell if we don't know more about the problem you are trying to solve.

Unless you tell us what you've tried, we're shooting in the dark about what confuses you or how to help you. We can give you advice but you may not know how to use it. Or you may just plop it in your code, but you may not know how to debug it. Or we could point you to documentation, but you may not know how to read it.

There are a zillion different ways a new Perl programmer can get confused. These may not apply to you but here are some:

For an even longer list see, I know what I mean. Why don't you?.

I hope you can see why people who really, really want to help you get just a little bit frustrated when you ask a question with no explanation of (a) why you want to do X (b) what problem you hope it will solve (c) what you have already tried to solve that problem.

Secondly, we like to see people who have put some effort in because it shows they have the temperament to really benefit from our help. It means they are willing to work to learn. Even with our help, a learner still has to work. We can't make those brain cog wheels turn for you. Only you can do that. If you aren't sure how to search for answer on your own, then make that your question. Instead of "can I lock a file", ask "how do I go about looking up information about locking files in Perl?"

Here are some tips on finding out things for yourself:

Best, beth