use POSIX qw(:sys_wait_h); $|++; defined(my $pid = fork) or die "Couldn't fork: $!"; if (!$pid) { # Child exec('long_running_command', @args) or die "Couldn't exec: $!"; } else { # Parent while (! waitpid($pid, WNOHANG)) { print "."; sleep 1; } print "\n"; }