#Twirling baton progress indicator sub twirling_baton { my $interval = 1; #Sleep time between twirls my $tcount = 0; my @baton = qw( | / - \ ); $| = 1; while ($interval) { $tcount++; print $baton[ $tcount % @baton ]; sleep ($interval); print "\b\b"; } } #### my $pid; if ($pid = fork) { &twirling_baton(); waitpid($pid,0) } else { system("$program < $temp_file"); defined($pid) or die "fork: $!\n"; exit; }