also i would like to know about the WNOHANG passed as parameter to waidpid();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"; }
In reply to what does $|++ do here? by deep3101
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |