in reply to Generating an httpd.conf from http://example.com/perl-status
use strict; use warnings; my $configfile2parse = 'httpd.conf'; my $configfile2check = 'httpd.conf-stripped'; open FH, '<', $configfile2parse or die "cannot open httpd.conf"; my @content = <FH>; close FH; my $opener = qr{<Perl>}; my $closer = qr{</Perl>}; my @httpd_config_only = grep {!(/$opener/sg .. /$closer/sg)} @content; open NH, '>>', $configfile2check or die "cannot open output file"; print NH $_ for @httpd_config_only; close NH; my $result = qx!httpd -S -f /work/$configfile2check!; print $result . $/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Generating an httpd.conf from http://example.com/perl-status
by Plankton (Vicar) on Mar 11, 2009 at 17:17 UTC | |
by hsinclai (Deacon) on Mar 11, 2009 at 22:53 UTC |