8 @ISA = qw( HTML::Parser );
13 use vars qw($VERSION $BRANCH);
14 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
15 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
16 $main::build += $VERSION;
17 $main::branch += $BRANCH;
22 my $self = SUPER::new $pkg;
24 $self->{state} = 'pre';
25 $self->{sort} = undef;
27 $self->{call} = uc shift;
33 my ($self, $tag, $attr, $attrseq, $origtext) = @_;
35 print "$self->{state} $tag";
37 my $dd = new Data::Dumper([$attr], [qw(attr)]);
41 print " ", $dd->Dumpxs;
45 if ($self->{state} eq 'addr') {
47 $self->{addr} .= ", " if length $self->{addr} > $self->{laddr};
48 $self->{laddr} = length $self->{addr};
49 } elsif ($tag eq 'p') {
50 push @{$self->{list}}, $self->{addr} ? "$self->{call}|addr|$self->{addr}" : "$self->{call}|addr|unknown";
51 $self->state('semail');
53 } elsif ($self->{state} eq 'email') {
55 my $email = $attr->{href};
57 return if $email =~ m{/uedit.html};
58 $email =~ s/mailto://i;
59 push @{$self->{list}}, "$self->{call}|email|$email";
61 } elsif ($tag eq 'br' || $tag eq 'p') {
69 my ($self, $text) = @_;
70 $text =~ s/^[\s\r\n]+//g;
71 $text =~ s/[\s\r\n]+$//g;
72 print "$self->{state} text $text\n" if $self->{debug};
74 if ($self->{state} eq 'pre' && $text =~ /$self->{call}/i ) {
78 } elsif ($self->{state} eq 'addr') {
79 $text =~ s/\ //gi;
80 $self->{addr} .= $text;
81 } elsif ($self->{state} eq 'semail' && $text =~ /Email/i ) {
82 $self->state('email');
90 $self->{state} = shift if @_;
91 return $self->{state};
96 my ($self, $tag, $origtext) = @_;
97 print "$self->{state} /$tag\n" if $self->{debug};
102 my ($self, $val) = @_;
103 $self->{debug} = $val;
109 return @{$self->{list}};