foreach my $line ( qx[ps -ef] ) { # find the $line you're looking for }