#!/usr/bin/perl use strict; use warnings; use IPC::Run qw( start pump finish ); open(LOG, '>', 'log') or die "Unable to open log: $!"; my ($in, $out); my $h = start([ 'run_tool', '-f', 'test.tcl' ], \$in, \$out, \$out); while($h->pump) { print LOG $out; $out = ''; } $h->finish; close(LOG); print "Exit code was: " . $h->result . "\n";