Thank you everyone.  All of you have been a great help.  That is exactly
what I need.  I'll figure out how to get just the servernames from the
VirtualHosts myself (I'll try anyway)  ;-)

Thanks!
Tyler

----- Original Message -----
From: "Brett W. McCoy" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>
Cc: "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 9:18 AM
Subject: Re: arrays


> 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.

Reply via email to