perl script to remove entire tags!?

N

Nigel

hello

with perl is there a way to delete entire <tags> text </tags> from a file?

the apache vhost.conf has many sites but when one is deleted, they need to
be deleted. ServerName is always unique though. is there a perl script that
can delete multiline expressions?

<VirtualHost *>
ServerName testdomain12.com
ServerAdmin (e-mail address removed)
ErrorLog /home/sites/site61/log_errorlog
CustomLog /home/sites/site61/log_customlog common
DocumentRoot /home/sites/site61/www
RewriteEngine on
<Directory /home/sites/site61/www>
Options Indexes
#ExecCGI
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

thanks.
 
J

Jürgen Exner

Nigel said:
with perl is there a way to delete entire <tags> text </tags> from a
file?

Seems you are looking for XML::parser or maybe HTML::parser?

jue
 
K

Kevin Collins

hello

with perl is there a way to delete entire <tags> text </tags> from a file?

the apache vhost.conf has many sites but when one is deleted, they need to
be deleted. ServerName is always unique though. is there a perl script that
can delete multiline expressions?

<VirtualHost *>
ServerName testdomain12.com
ServerAdmin (e-mail address removed)
ErrorLog /home/sites/site61/log_errorlog
CustomLog /home/sites/site61/log_customlog common
DocumentRoot /home/sites/site61/www
RewriteEngine on
<Directory /home/sites/site61/www>
Options Indexes
#ExecCGI
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

See 'perldoc perlre' - specifically the 1st few paragraphs describing the 'm'
and 's' modifiers. You should be able to come up with a multi-line regexp that
will handle that for you.

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top