open pipe from ps aux, perhaps after grepping for sendmail while() { my ($owner, $pid, undef, undef, undef, undef, undef, undef, undef, undef, # Throw eight values away $command_withIP) = split(' ', $_, 11); Do stuff }