in reply to Re: server to server communication
in thread server to server communication

Thanks for the suggestion Luke. I have read the documentation for fork and it will spawn a UNIX process. From there I have to have UNIX call the other server process? I may be making too much of this, but my understanding is I would have to set up a local perl script that redirects to the HTTP address I am interested in and have the fork process call that local script?

What would be ideal is:
&get("http://www.mysite.com", do_not_wait_for_return);
I know get() does not take those kind of parameters, I am hoping some other function within perl does.

Thanks.

Replies are listed 'Best First'.
Re^3: server to server communication
by McDarren (Abbot) on Jun 15, 2006 at 16:29 UTC
    Yes, I think you are making too much of this :)

    Before I go on, I'll just say from the outset that I've not written a lot of code that uses forking, so I won't profess to be an expert on the subject.

    However, based on my understanding, here is a simple example to demonstrate how fork works.

    #!/usr/bin/perl -wl use strict; defined (my $pid = fork) or die "Cannot fork: $!"; unless ($pid) { for (1 .. 20) { print "CHILD: $_"; sleep 1; } exit 0; } for (1 .. 20) { print "PARENT: $_"; sleep 1; }

    When the above is executed, you get both loops printing at the same time. That is, the second loop doesn't wait for the first to complete. Which is pretty much what you are after, no?

    Cheers,
    Darren :)

      Thanks Darren. With this I can use the get() inside the fork. I am pretty sure this will work. Thank you very much for your help