in reply to How to synchronize the one subroutine

I'm not sure exactly what you are looking for. What is it that you want to synchronize your subroutine with?

Maybe you want to flush the buffers of the external file? Look at $| in perlvar, but closing the file would do that.

Maybe you have other scripts you need to synchronise with. Look at flock (UNIX/Linux) or Win32::Mutex (Windows), or maybe other IPC mechanisms.

  • Comment on Re: How to synchronize the one subroutine

Replies are listed 'Best First'.
Re^2: How to synchronize the one subroutine
by ikegami (Patriarch) on Sep 11, 2009 at 14:08 UTC
    flock works fine on Windows too
Re^2: How to synchronize the one subroutine
by kkavitha (Initiate) on Sep 22, 2009 at 05:51 UTC

    Thanks for your information

    One of the subroutine of our tool is exposed with external file like writing, rewriting, remove entry. Currently, when multiple user tried to use this tool at the same time, external file content has changed irrelevently. My requirement, external file should be edit by only one user at a time