in reply to Determining a Unix PID

You will want to have a look at the Proc::ProcessTable module which I have written about on this site previously here. The following code uses this module to retrieve the process IDs of any processes matching the regular expression passed to the subroutine get_pid:

use Proc::ProcessTable; my @pids = get_pid( 'httpd' ); sub get_pid { my ( $process ) = @_; my @pids = (); my $proc = Proc::ProcessTable->new; foreach ( @{ $proc->table } ) { if ($_->cmndline =~ /$process/) { push @pids, $_->pid; } } return @pids; }

 

perl -le 'print+unpack"N",pack"B32","00000000000000000000001001110110"'