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" }
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" }