################## print "Once\n"; sleep 2; print "Input Please? "; $line = ; chomp $line; print "You got: $line\n"; sleep 5; print "Twice\n"; ################## #### my $infile = "/tmp/foo.in"; my $outfile = "/tmp/foo.out"; my $binary = "./output.pl"; system("mkfifo $infile"); system("$binary < $infile > $outfile &"); open(DATA_OUT, ">$infile"); open(DATA_IN, "<$outfile"); while($line = ) { chomp $line; print "Got $line\n"; if ($line =~ /\?/) { print DATA_OUT, "blah\n"; } } close(DATA_OUT); close(DATA_IN); system("rm $infile $outfile");