Bryan Harris wrote: > > I have an odd problem... > > I have a perl script that execs another program: > > $cmd = "motuds t1.dat t2.dat t3.dat > out1"; > exec $cmd; > > Motuds takes awhile to run, though, and I often want to see how it's doing: > > % tail -f out1 > > The problem is, the output of motuds is not getting written out to the file > immediately. Somehow it's getting cached somewhere, and only gets written > out once in a while. If I type that command on the command line, the tail > command works properly. So something with the exec process is causing the > output to be buffered. > > Does anyone happen to know why?
Try this and see if it helps: open IN, 'motuds t1.dat t2.dat t3.dat |' or die "Cannot open pipe from motuds: $!"; open OUT, '> out1' or die "Cannot open out1: $!"; select OUT; $| = 1; print while <IN>; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]