Something like that might help...($^I,@ARGV)=('.bak','file.txt'); while(<>){ my $c=$_=~/<VirtualHost.*>/..$_=~m!</VirtualHost>!; print unless $c; if($c==2){($ServerName)=/ServerName (.*)$/} }
In reply to Re: Parsing file and removing a section
by Ido
in thread Parsing file and removing a section
by brendonc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |