use strict; use warnings; sub get_childpids { my $father=shift; # linux style my @exec=`ps -o pid --ppid $father` or die "can't run ps! $! \n"; # SYS V style : use shell, needs cleansing # my @exec=`ps -eo ppid | grep $father` or die "can't run ps! $! \n"; # BSD style : use shell, needs cleansing # my $exec=`ps aux | grep $father` or die "can't run ps! $! \n"; shift @exec; chomp @exec; return @exec; }