open PS, "ps -A |"; # Note: not all versions of ps use the same args; # -A works on Linux systems, but you may need # -x on some systems, e.g., Darwin. my @instance = grep { /abcd/ } ; print "Running Instances:\n"; print join "\n", map { "\t$_" } @instances; print "\n";