in reply to Re: Synchronous action
in thread Synchronous action

Maybe I used wrong terminology. Not to make it complicated, I just wanted all robocopy to be started at teh same time from one source to multilple machines. PARALLEL. It saves time. If done in SERIAL, it takes a long time for the robocopy to finish. I shall research on FORK, meanwhile, I hope you get my idea, what am trying to do and using "synchronization" might have confused you all. oops.

Replies are listed 'Best First'.
Re^3: Synchronous action
by BrowserUk (Patriarch) on May 12, 2011 at 19:04 UTC

    All you need is:

    for my $client ( @clients ) { ## Note: the '1' first parameter to system ## which means that the command will be executed asynchronously system 1, qq[ robocopy $srcmachine $client ]; }

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Can you explain what this does? Instead of calling robocopy at the same line, I would like to copy a function with two arguments, src and dest. meaning like this.
      system 1, &startCopy( $srcMachine $client->[0]);
      But (in eclipse), its giving me a syntax error. Any suggestions on this?
        Can you explain what this does?

        Did you try looking up what the system function does?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.