52 |
my $version = 0; |
my $version = 0; |
53 |
my $old; |
my $old; |
54 |
|
|
55 |
my $rc = GetOptions ('help' => \$help, 'version' => \$version, |
my $rc = GetOptions ('help' => \$help, 'version' => \$version, |
56 |
'old=s' => \$old); |
'old=s' => \$old); |
57 |
if ($version) { |
if ($version) { |
58 |
print "0.1\n"; |
print "0.1\n"; |
86 |
close IN; |
close IN; |
87 |
} |
} |
88 |
|
|
89 |
# Process current files and remove those @tindex lines which we |
# Process current files and remove those @tindex lines which we |
90 |
# know were already present in the files scanned above. |
# know were already present in the files scanned above. |
91 |
|
|
92 |
print "Removing old \@tindex lines\n"; |
print "Removing old \@tindex lines\n"; |
93 |
foreach $file (@new_files) { |
foreach $file (@new_files) { |
94 |
my $modified = 0; |
my $modified = 0; |
95 |
my $contents = ""; |
my $contents = ""; |
96 |
|
|
97 |
open (IN, "< $file") or fatal "Cannot open $file.orig for reading: $!"; |
open (IN, "< $file") or fatal "Cannot open $file.orig for reading: $!"; |
98 |
while (<IN>) { |
while (<IN>) { |
99 |
if (/^\s*\@tindex\s+(\S+)/ && $tindex{$1}) { |
if (/^\s*\@tindex\s+(\S+)/ && $tindex{$1}) { |
103 |
$contents = $contents . $_; |
$contents = $contents . $_; |
104 |
} |
} |
105 |
} |
} |
106 |
|
|
107 |
close IN; |
close IN; |
108 |
|
|
109 |
if ($modified) { |
if ($modified) { |