Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Two consoles, each with their own distinct process

Posted on 2007-07-08 19:53:08 by 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.

Report this message

#2: Re: Two consoles, each with their own distinct process

Posted on 2007-07-08 20:28:18 by 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 <<EOC;
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

Report this message