This code should get you started.
#!/usr/bin/perl -w use strict; use HTML::TokeParser::Simple; my $parser = HTML::TokeParser::Simple->new(\*DATA); my $new_title = 'Some title'; my $html = ''; while (defined (my $token = $parser->get_token)) { if ($token->is_start_tag('title')) { $html .= $token->as_is . $new_title; $token = $parser->get_tag('/title'); # advance to last title t +ag; } $html .= $token->as_is; } print $html; __DATA__ <html> <head> <title> This is a title </title> </head> <body> <p>This is the body</p> </body> </html>
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: Rename html page titles
by Ovid
in thread Rename html page titles
by Concept99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |