File: remove-gtkdoclink.pl

package info (click to toggle)
xmlsec1 1.2.14-1%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,492 kB
  • ctags: 8,701
  • sloc: ansic: 61,722; sh: 11,345; xml: 11,035; makefile: 908; perl: 85
file content (20 lines) | stat: -rwxr-xr-x 461 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w

use strict;

my $file;
while ($file = shift @ARGV) {
    print "Processing $file..\n";
    open (IN, $file) || die "Can't open $file: $!";
    my $entire_file;
    while(<IN>) {
	$entire_file = $entire_file . $_;
    }
    close (IN);
    $entire_file =~ s%<GTKDOCLINK\s+HREF="([^"]*)"\s*>(.*?)</GTKDOCLINK\s*>% "<font>$2</font>" %ge;

    open (OUT, ">$file") || die "Can't open $file: $!";
    print OUT $entire_file;
    close (OUT);	
}