tricky stdout

G

George Mpouras

I use the s1.pl to feed with data the s2.pl
is there any way s1.pl to catch back the output of s2.pl ?

# s1.pl
open SHELL, '|-', './s2.pl' or die "Could not run shell $?\n";
print SHELL "$_\n" foreach 'a1', 'a2', 'a3';
close SHELL;

# s2.pl
while (<STDIN>) {
chomp $_;
print STDOUT "s2 $$ received \"$_\"\n" }
 
J

Jürgen Exner

George Mpouras said:
I use the s1.pl to feed with data the s2.pl
is there any way s1.pl to catch back the output of s2.pl ?

perldoc -q pipe
"How can I open a pipe both to and from a command?"

jue
 
G

George Mpouras

Στις 23/12/2013 17:47, ο/η Jürgen Exner έγÏαψε:
"How can I open a pipe both to and from a command?"

use IPC::Open2 is doing the trick , thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top