js1 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm writing a script to upgrade an apache configuration file and have a script which reads through each line using the while(<>) contruct.
My question is, what's the best way to match on a block of text such as below:
Alias /icons/ "/opt/apache_2.0.48/icons/" <Directory "/opt/apache_2.0.48/icons/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
and change this to:
#Alias /icons/ "/opt/apache_2.0.54/icons/" #<Directory "/opt/apache_2.0.54/icons"> # Options Indexes MultiViews # AllowOverride None # Order allow,deny # Allow from all #</Directory>
Thanks for any help,
js1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: match and edit block of text
by mugwumpjism (Hermit) on Jun 03, 2005 at 06:22 UTC | |
by js1 (Monk) on Jun 03, 2005 at 08:41 UTC | |
|
Re: match and edit block of text
by bart (Canon) on Jun 03, 2005 at 06:41 UTC | |
|
Re: match and edit block of text
by rg0now (Chaplain) on Jun 03, 2005 at 07:14 UTC | |
|
Re: match and edit block of text
by aukjan (Friar) on Jun 03, 2005 at 06:26 UTC | |
|
Re: match and edit block of text
by Zaxo (Archbishop) on Jun 03, 2005 at 06:20 UTC | |
|
Re: match and edit block of text
by ww (Archbishop) on Jun 05, 2005 at 15:07 UTC |