Take the 2-minute tour ×  I'm fairly new to Perl and have been
searching the interwebs for documentation for what I'm trying to
do. I'm not having any luck.  I have a program that outputs
information to stdout with prompts throughout. I need to make a
Perl script to pipe that information to a file.  I thought I
could use Expect but there seems to be a problem with the pipe
after the first prompt.  Here is the part of my code:  # Run
program and compare the output to the BASE file $cmd =
"./program arg1 arg2 arg3 arg4 > $outfile";  my $exp = new
Expect; BAIL_OUT("couldn't create expect object") if (! defined
$exp);   For this case there is only a single prompt for the
user to press "enter". This program is small and very fast - 2
seconds is plenty of time to reach the first prompt.  The output
file only contains the first half of the information.  Does
anyone have any suggestions on how I can grab the second half as
well?  UPDATE: I've verified that this works with Expect by
using a simple script:  spawn ./pro