in reply to Searching strings within an array for a particular word.

If you want to make sure httpd is responding versus has a process running, try the following:
#!/usr/local/bin/perl -w use strict; use LWP::UserAgent; my $debug = 0; my $url = shift || die "Syntax is '$0 url-to-test': $!"; $debug && print "URL is $url\n"; my $ua = new LWP::UserAgent; my $request = HTTP::Request->new('GET', "$url"); my $response = $ua->request($request); if ($response->is_success) { exit 0; } else { exit 1; }
I have been bitten in the past by checking for a process running.