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.
| [reply] [d/l] |
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 :) | [reply] [d/l] |
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
| [reply] |