in reply to Working With Processes and Their children
#!/usr/bin/perl use warnings; use strict; use Proc::ProcessTable; $SIG{CHLD} = 'IGNORE'; for(1..5){ sleep(10) and exit if(fork == 0); } for my $p (@{new Proc::ProcessTable->table}){ print $p->pid," child of $$\n" if($p->ppid == $$); }
|
|---|