#!/usr/bin/perl
use Getopt::Long;
my $prefix = '';
GetOptions( 'prefix=s' => \$prefix,
'title=s' => \$title,
'main=s' => \$main ) || die "Wrong options\n";
$file = $ARGV[0];
open(FILE, "$file") || die "File not found: $file\n";
$prevdepth = 1;
$depth = 1;
print ") {
if (/^\s*href/ && !/.*\<\/A\>$/i) {
chop;
$_ = $_ . ;
}
if (/\/i) {
$depth++;
} elsif (/\<\/UL\>/i) {
print "/" if ($prevdepth == $depth);
$depth--;
print ">\n
(.+)\<\/A\>$/i) {
$url = "$prefix/$1";
$name = dehtml($2);
$name =~ s/\s+/ /g;
print "/" if ($prevdepth == $depth);
print ">\n\n";
close(FILE);
sub dehtml
{
my ( $str ) = @_;
$str =~ s/\<(tt|b) class=\"([^\"]*)\"\>//g;
$str =~ s/\<\/(tt|b)\>//g;
$str =~ s/\//g;
$str =~ s/\<\/i\>//g;
return $str;
}
# Local Variables:
# mode: perl
# fill-column: 120
# End: