On Thu, 28 Jun 2001, Tyler Longren wrote:
> I'm just starting perl. I want to search through httpd.conf and get the
> ServerName from each virtual host.
Sure:
open(APACHE_CONF, "httpd.conf") or die "Could not open Apache config file:
$!\n";
my @servernames;
while(<APACHE_CONF>) {
if(/^ServerName\s(.*)$/i) {
push @servernames, $1;
}
}
close(APACHE_CONF);
-- Brett
http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Tuesday After Lunch is the cosmic time of the week.