use strict; my @procs = qw|mozilla evolution|; foreach my $process(@procs) { open ( PROCS, "ps -ef |grep $process |grep -v grep|" ) or die "Couldn't open procs $!"; while ( my $proc = ) { chomp $proc; if ( defined( $proc ) ) { print "looks okay here\n"; } else { print "couldn't find $process - you're screwed\n"; } } }