1008945528
this has been replaced by `for`
26 lines
381 B
Perl
Executable File
26 lines
381 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
my $file = $ARGV[0];
|
|
|
|
my @lines = <>;
|
|
|
|
my $anchors = {};
|
|
|
|
my $i = 0;
|
|
for $line (@lines) {
|
|
$i++;
|
|
if ($line =~ m/id="([^"]+)"/) {
|
|
$anchors->{$1} = $i;
|
|
}
|
|
}
|
|
|
|
$i = 0;
|
|
for $line (@lines) {
|
|
$i++;
|
|
while ($line =~ m/href="#([^"]+)"/g) {
|
|
if (! exists($anchors->{$1})) {
|
|
print "$file:$i: $1 referenced\n";
|
|
}
|
|
}
|
|
}
|