File Coverage

blib/lib/Email/Thread.pm
Criterion Covered Total %
statement 12 17 70.5
branch n/a
condition n/a
subroutine 4 7 57.1
pod n/a
total 16 24 66.6


line stmt bran cond sub pod time code
1 1     1   62696 use strict;
  1         10  
  1         26  
2 1     1   4 use warnings;
  1         2  
  1         45  
3             package Email::Thread 0.713;
4             # ABSTRACT: Use JWZ's mail threading algorithm with Email::Simple objects
5              
6 1     1   382 use parent 'Mail::Thread';
  1         240  
  1         4  
7              
8             sub _get_hdr {
9 0     0     my ($class, $msg, $hdr) = @_;
10 0           $msg->header($hdr);
11             }
12              
13 0     0     sub _container_class { "Email::Thread::Container" }
14              
15             package Email::Thread::Container 0.713;
16 1     1   27681 use parent -norequire, 'Mail::Thread::Container';
  1         2  
  1         5  
17              
18 0     0     sub header { eval { $_[0]->message->header($_[1]) } }
  0            
19              
20             1;
21              
22             =pod
23              
24             =encoding UTF-8
25              
26             =head1 NAME
27              
28             Email::Thread - Use JWZ's mail threading algorithm with Email::Simple objects
29              
30             =head1 VERSION
31              
32             version 0.713
33              
34             =head1 SYNOPSIS
35              
36             use Email::Thread;
37             my $threader = Email::Thread->new(@messages);
38              
39             $threader->thread;
40              
41             dump_em($_,0) for $threader->rootset;
42              
43             sub dump_em {
44             my ($self, $level) = @_;
45             debug (' \\-> ' x $level);
46             if ($self->message) {
47             print $self->message->header("Subject") , "\n";
48             } else {
49             print "[ Message $self not available ]\n";
50             }
51             dump_em($self->child, $level+1) if $self->child;
52             dump_em($self->next, $level) if $self->next;
53             }
54              
55             =head1 DESCRIPTION
56              
57             Strictly speaking, this doesn't really need L objects.
58             It just needs an object that responds to the same API. At the time of
59             writing the list of classes with the Email::Simple API comprises just
60             Email::Simple.
61              
62             Due to how it's implemented, its API is an exact clone of
63             L. Please see that module's documentation for API
64             details. Just mentally substitute C everywhere you see
65             C and C where you see
66             C.
67              
68             =head1 PERL VERSION
69              
70             This module should work on any version of perl still receiving updates from
71             the Perl 5 Porters. This means it should work on any version of perl released
72             in the last two to three years. (That is, if the most recently released
73             version is v5.40, then this module should work on both v5.40 and v5.38.)
74              
75             Although it may work on older versions of perl, no guarantee is made that the
76             minimum required version will not be increased. The version may be increased
77             for any reason, and there is no promise that patches will be accepted to lower
78             the minimum required perl.
79              
80             =head1 THANKS
81              
82             Simon Cozens (SIMON) for encouraging me to release it, and for
83             Email::Simple and Mail::Thread.
84              
85             Richard Clamp (RCLAMP) for the header patch.
86              
87             =head1 SEE ALSO
88              
89             L, L, L
90              
91             =head1 AUTHOR
92              
93             Iain Truskett
94              
95             =head1 CONTRIBUTOR
96              
97             =for stopwords Ricardo Signes
98              
99             Ricardo Signes
100              
101             =head1 COPYRIGHT AND LICENSE
102              
103             This software is copyright (c) 2003 by Iain Truskett .
104              
105             This is free software; you can redistribute it and/or modify it under
106             the same terms as the Perl 5 programming language system itself.
107              
108             =cut
109              
110             __END__