/[wait]/cvs-head/lib/WAIT/Parse/Overview.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /cvs-head/lib/WAIT/Parse/Overview.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 47 by ulpfr, Fri Dec 29 15:33:06 2000 UTC revision 48 by ulpfr, Fri Dec 29 16:09:58 2000 UTC
# Line 4  Line 4 
4  # Author          : Ulrich Pfeifer  # Author          : Ulrich Pfeifer
5  # Created On      : Thu Sep  5 16:17:38 1996  # Created On      : Thu Sep  5 16:17:38 1996
6  # Last Modified By: Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
7  # Last Modified On: Fri Dec 29 16:26:17 2000  # Last Modified On: Fri Dec 29 17:01:42 2000
8  # Language        : CPerl  # Language        : CPerl
9  # Update Count    : 66  # Update Count    : 75
10  # Status          : Unknown, Use with caution!  # Status          : Unknown, Use with caution!
11  #  #
12  # Copyright (c) 1996-1997, Ulrich Pfeifer  # Copyright (c) 1996-1997, Ulrich Pfeifer
# Line 23  sub split {                     # called Line 23  sub split {                     # called
23    my %result;    my %result;
24    my $fld;    my $fld;
25        
26    @result{qw(subject from to)} = (split /\t/, $_[1])[1,2,9];    @result{qw(article subject from to)} = (split /\t/, $_[1])[0,1,2,9];
27        $result{subject} = WAIT::Filter::unmime($result{subject});
28    return \%result;              # we go for speed    return \%result;              # we go for speed
29  }  }
30    
# Line 35  sub tag {                       # called Line 35  sub tag {                       # called
35    
36    local $_ = $_[1];    local $_ = $_[1];
37    
38    s/^([^\t]*\t)//; push @result, {}, $1;    s/^([^\t]*\t)//; push @result, { article => 1}, $1;
39    s/^([^\t]*\t)//; push @result, { subject => 1}, $1;    s/^([^\t]*\t)//; push @result, { subject => 1}, WAIT::Filter::unmime($1);
40    s/^([^\t]*\t)//; push @result, { from    => 1}, $1;    s/^([^\t]*\t)//; push @result, { from    => 1}, $1;
41    s/^([^\t]*\t){7,7}//; push @result, {}, $1;    s/^([^\t]*\t){7,7}//; push @result, {}, $1;
42    s/^([^\t]*\t)//; push @result, { to    => 1}, $1;    s/^([^\t]*\t)//; push @result, { to    => 1}, $1;
# Line 46  sub tag {                       # called Line 46  sub tag {                       # called
46    return @result;               # we don't go for speed    return @result;               # we don't go for speed
47  }  }
48    
49    package WAIT::Filter;
50    
51    sub unmime {
52      local($_) = @_;
53    
54      return '' unless defined $_;
55    
56      if (s/\Q=?iso-8859-1?Q?\E(.*)\?=/$1/) {
57        s/_/ /g;
58        s/=([0-9AF]{2,2})/pack 'C', hex($1)/eg;
59      }
60      $_;
61    }
62    
63  1;  1;
64    

Legend:
Removed from v.47  
changed lines
  Added in v.48

  ViewVC Help
Powered by ViewVC 1.1.26