#!/usr/bin/perl
use Getopt::Long;
my $prefix = '';
GetOptions( 'prefix=s' => \$prefix ) || die "Wrong options\n";
$file = $ARGV[0];
open(FILE, "$file") || die "File not found: $file\n";
print "\n";
$ingroup = 0;
while () {
if (/\\(.+)\<\/a\>/) {
# print "Index: $1, $2, $ingroup\n";
if ($ingroup) {
$name = "$ingroup, $2";
} else {
$name = $2;
}
$url = "$prefix/$1";
print "\n";
} elsif (/\(.+)/) {
# print "Ingroup: $1\n";
$ingroup = $1;
} elsif (/\s+\<\/dl>/) {
$ingroup = 0;
}
}
print "\n";
close(FILE);
sub dehtml
{
my ( $str ) = @_;
$str =~ s/\//g;
$str =~ s/\<\/CODE\>//g;
$str =~ s/\//g;
$str =~ s/\<\/TT\>//g;
return $str;
}