I don't have time to write real perl but I would do something like this:
open FIL or die;
my $flag = 0;
while <FIL> {
if (/<VirtualHost//) {
# print "$_"; # uncomment to get the opening tag
$flag = 1;
}
if ($flag && !(/<\/VirtualHost//)) {
print "$_";
}
if (/<\/VirtualHost//) {
# print "$_"; # uncomment to get the closing tag
$flag = 0;
}
}
--the print statements will print everything between the VirtualHost
containers. You could do something other than print. If someone has
screwed up and not matched open and closes, this algorithm will fail. I'm
sure there are prettier ways... it seems you could also slurp the whole
config file into one "line" and do a regex to parse out the containers.
-Alan
---
Alan D. Mead / Research Scientist / [EMAIL PROTECTED]
Institute for Personality and Ability Testing
1801 Woodfield Dr / Savoy IL 61874 USA
217-352-4739 (v) / 217-352-9674 (f)
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.