Two consoles, each with their own distinct process
am 08.07.2007 19:53:08 von venet
I am faced with a program that is written in Perl from which I am required
to grab a value at the end of the script's run. And, with nobody wanting to
modify that script, it is likely that any program reaching out and grabbing
that value will be a separate process; it will be another separate
standalone Perl script.
First question: does this arrangement fall under the category of (what I
recently discovered) is something called Inter-process Communication (IPC)?
Second question: If yes, or something like it, can somebody show me a sample
combination that consists of (A) a simple Perl script that is run on one
console, returns three distinct variables' values (let's say "Hello,
world!," "The sky is blue.," and "The grass is green."), and (B) an
entirely separate console--that has an entirely different Perl script--that
is designed to reach way over to the other runtime, and pick off only the
value correlating with the string "The sky is blue."?
Any help would be very much appreciated. Thank you.
Re: Two consoles, each with their own distinct process
am 08.07.2007 20:28:18 von Gunnar Hjalmarsson
venet wrote:
> I am faced with a program that is written in Perl from which I am required
> to grab a value at the end of the script's run. And, with nobody wanting to
> modify that script, it is likely that any program reaching out and grabbing
> that value will be a separate process; it will be another separate
> standalone Perl script.
>
> First question: does this arrangement fall under the category of (what I
> recently discovered) is something called Inter-process Communication (IPC)?
>
> Second question: If yes, or something like it, can somebody show me a sample
> combination that consists of (A) a simple Perl script that is run on one
> console, returns three distinct variables' values (let's say "Hello,
> world!," "The sky is blue.," and "The grass is green."), and (B) an
> entirely separate console--that has an entirely different Perl script--that
> is designed to reach way over to the other runtime, and pick off only the
> value correlating with the string "The sky is blue."?
C:\home>type test2.pl
#!/usr/bin/perl
print <
Hello, world!
The sky is blue.
The grass is green.
EOC
C:\home>type test.pl
#!/usr/bin/perl
@values = qx(test2.pl);
print grep /blue/, @values;
C:\home>test.pl
The sky is blue.
C:\home>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl