Code

added aix
[rrdtool-all.git] / website / bin / fix-hrefs.pl
1 #!/usr/bin/perl -w
3 use strict;
4 use HTML::Parser;
6 my $p = HTML::Parser->new(api_version => 3);
7 $p->handler(start => \&startsub, 'tagname, text');
8 #$p->handler(end => \&endsub, 'tagname, text');
9 $p->handler(default => sub { print shift() }, 'text');
10 $p->parse_file(shift||"-") or die("parse: $!");
12 sub startsub {
13         my $tag = shift;
14         my $text = shift;
15         
16         if ($tag eq "a") {
17                 $text =~ s,/home/oetiker/data/svn-checkout/rrdtool/branches/1.2/website/doc/,,;
18                 $text =~ s,\.html,.en.html,;
19         }
20         print $text;
21 }