I'm trying to write a perl program on windows that calls a second perl program and then "talks" to that second program. I can start the second program using win32::Process but then how can I do the talking? I assume over a socket on localhost, but I'm not sure how to do that and I've been trying to find more information. Here is what this second program is going to look like for the most part. It's just going to sit there and listen for things from the socket (here just reading from standard in for an example...) and then go get a web page it's told to get.
#!/usr/local/bin/perl -w
use LWP::UserAgent;
use URI::URL;
my $ua = LWP::UserAgent->new;
while($line = <STDIN>) {
chomp($line);
if ($line =~ /now_done/) {
last;
} else {
$url = $line;
$file = 'some_web_page.txt';
my $req = HTTP::Request->new(GET => $url);
$req->header('Accept' => 'text/html');
$ua->request($req, $file);
}
};
print "done now\n";
exit;
So you can run this program as is, and if you type in something like "http://www.yahoo.com" and enter it will go get that page and put it in a file. But how would the original program that started this program send it things.
Thanks for any help!!
Justin Eltoft
"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews