1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
2 |
# -*- Mode: Perl -*- |
# -*- Mode: Perl -*- |
3 |
# $Basename: HTML.pm $ |
# $Basename: HTML.pm $ |
4 |
# $Revision: 1.3 $ |
# $Revision: 1.4 $ |
5 |
# Author : Ulrich Pfeifer with Andreas König |
# Author : Ulrich Pfeifer with Andreas König |
6 |
# Created On : Sat Nov 1 1997 |
# Created On : Sat Nov 1 1997 |
7 |
# Last Modified By: Ulrich Pfeifer |
# Last Modified By: Ulrich Pfeifer |
68 |
|
|
69 |
sub split { |
sub split { |
70 |
my ($self, $doc) = @_; |
my ($self, $doc) = @_; |
71 |
my %doc = ( isbn => '', author => '', about => '' ); |
my %doc = ( isbn => '', author => '', about => '', colophon => '' ); |
72 |
my $desc = $doc->{desc}; |
my $desc = $doc->{desc}; |
73 |
my $auth = $doc->{author}; |
my $auth = $doc->{author}; |
74 |
|
my $colophon = $doc->{colophon}; |
75 |
|
|
76 |
if ($doc->{author}) { |
if ($doc->{author}) { |
77 |
%result = (); |
%result = (); |
80 |
$p->parse($doc->{author}); |
$p->parse($doc->{author}); |
81 |
$p->eof; |
$p->eof; |
82 |
$doc{author} = $result{title}; |
$doc{author} = $result{title}; |
83 |
|
$doc{author} =~ s/^By\s+//; |
84 |
$doc{about} = $result{text}; |
$doc{about} = $result{text}; |
85 |
} |
} |
86 |
if ($doc->{index}) { |
if ($doc->{index}) { |
87 |
$doc->{index} =~ /ISBN\s*([-\d]+)/ and $doc{isbn} = $1; |
$doc->{index} =~ /ISBN\s*([^<]+)/ and $doc{isbn} = $1; |
88 |
|
} |
89 |
|
if ($doc->{colophon}) { |
90 |
|
%result = (); |
91 |
|
$text = ''; |
92 |
|
$open = 0; |
93 |
|
$p->parse($doc->{colophon}); |
94 |
|
$p->eof; |
95 |
|
$doc{colophon} = $result{text}; |
96 |
} |
} |
97 |
%result = (); |
%result = (); |
98 |
$text = ''; |
$text = ''; |