/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 48 - (show annotations)
Fri Dec 29 16:09:58 2000 UTC (23 years, 4 months ago) by ulpfr
File size: 1475 byte(s)
Mail indexing works resonable

1 # -*- Mode: Perl -*-
2 # Bibdb.pm --
3 # ITIID : $ITI$ $Header $__Header$
4 # Author : Ulrich Pfeifer
5 # Created On : Thu Sep 5 16:17:38 1996
6 # Last Modified By: Ulrich Pfeifer
7 # Last Modified On: Fri Dec 29 17:01:42 2000
8 # Language : CPerl
9 # Update Count : 75
10 # Status : Unknown, Use with caution!
11 #
12 # Copyright (c) 1996-1997, Ulrich Pfeifer
13 #
14
15 package WAIT::Parse::Overview;
16 require WAIT::Parse::Base;
17 use strict;
18 use vars qw(@ISA);
19
20 @ISA = qw(WAIT::Parse::Base);
21
22 sub split { # called as method
23 my %result;
24 my $fld;
25
26 @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
29 }
30
31
32 sub tag { # called as method
33 my @result;
34 my $tag;
35
36 local $_ = $_[1];
37
38 s/^([^\t]*\t)//; push @result, { article => 1}, $1;
39 s/^([^\t]*\t)//; push @result, { subject => 1}, WAIT::Filter::unmime($1);
40 s/^([^\t]*\t)//; push @result, { from => 1}, $1;
41 s/^([^\t]*\t){7,7}//; push @result, {}, $1;
42 s/^([^\t]*\t)//; push @result, { to => 1}, $1;
43
44 push @result, {}, $_;
45
46 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;
64

Properties

Name Value
cvs2svn:cvs-rev 1.2

  ViewVC Help
Powered by ViewVC 1.1.26