Mail::Thread::Chronological - rearrange Mail::Thread::Containers into a Chronological structure
use Mail::Thread; use Mail::Thread::Chronological; my $threader = Mail::Thread->new( @messages ); my $lurker = Mail::Thread::Chronological->new; $threader->thread; for my $thread ($threader->rootset) { for my $row ( $lurker->arrange( $thread ) ) { my $container = grep { ref $_ } @$row; print join('', map { ref $_ ? '*' : $_ } @$row), " ", $container->messageid, "\n"; } }
Given a Mail::Thread::Container, Mail::Thread::Chronological transforms the tree structure into a 2-dimensional array representing the history of a given thread in time.
The output is similar to that of the Lurker mail archiving system, with a couple of small exceptions:
The grid is populated with the characters ' ' (space), '-', '+', '|', '{', or Mail::Thread::Container objects. Lurker uses [a-g], and differentiates T-junctions from corners for you, this module assumes you will do that for yourself.
The characters mean:
empty cell
horizontal line
T junction or corner
vertical line
vertical line crossing over a horizontal line
In the original lurker crossing a path vertically is not allowed, this results in a lot of horizontal space being used.
your common or garden constructor
Returns an array of arrays representing the thread tree.
Extracts the time from a Mail::Thread::Container, returned as epoch seconds used to decide the order of adding messages to the rows.
Richard Clamp <richardc@unixbeard.net>
Lurker, the application that seems to have originated this form of time-based thread display.
Mail::Thread, Mariachi
To install Mail::Thread::Chronological, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Thread::Chronological
CPAN shell
perl -MCPAN -e shell install Mail::Thread::Chronological
For more information on module installation, please visit the detailed CPAN module installation guide.