$tpid = open(MLOG,"tail -f $log_dir/mkisofs.log |"); &log("Started mkisofs.log tail: pid = $tpid"); while ($line = ) { if ($line =~ /estimate finish/) { $line =~ s/^\s+//; #remove leading whitespace $perc = (split(/\s+/, $line))[0]; chop($perc); #get rid of the "%" $perc = sprintf("%3.0f", $perc); $progress_label -> configure(-text => "Completed: $perc%"); $progress_scale -> set($perc); $main->update; } last if $line =~ /extents written/; } kill('TERM', $tpid); #kill the tail process close(MLOG);