Email::Thread(3pm)

πŸ“¦
version 0.713 Β· 2 versions
  • 0.713 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.712 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’Œ Email::Thread β€” the manual, but make it a group chat

ok so bestie, you found the page for Email::Thread (that's the 3pm one, a User Contributed Perl Documentation page, if you're keeping track πŸŽ€). It lives in the Perl docs, it's giving very niche, very useful, and I'm lowkey obsessed. Let's get into it. ✨


🌸 NAME 🌸

Email::Thread β€” use JWZ's mail threading algorithm with Email::Simple objects. no cap, that's the whole pitch. πŸ¦‹


πŸ’– VERSION πŸ’–

version 0.713


πŸŽ€ SYNOPSIS πŸŽ€

ok here's the vibe, copy-paste ready:

use Email::Thread;
my $threader = Email::Thread->new(@messages);

$threader->thread;

dump_em($_,0) for $threader->rootset;

sub dump_em {
    my ($self, $level) = @_;
    debug (' \\-> ' x $level);
    if ($self->message) {
        print $self->message->header("Subject") , "\n";
    } else {
        print "[ Message $self not available ]\n";
    }
    dump_em($self->child, $level+1) if $self->child;
    dump_em($self->next, $level) if $self->next;
}

like. it threads your mail. then it dumps it. iconic behaviour honestly πŸ’…


✨ DESCRIPTION ✨

so technically-technically? it doesn't actually need Email::Simple objects. it just needs an object that responds to the same API. at the time of writing, the list of classes with the Email::Simple API comprises just Email::Simple. that's the whole list. one item. slay. πŸ‘‘

and because of how it's implemented, its API is an exact clone of Mail::Thread. so go read that module's documentation for the API details, bestie β€” that's where the real tea is. just mentally substitute Email::Thread everywhere you see Mail::Thread, and Email::Thread::Container where you see Mail::Thread::Container. it's giving find-and-replace, and I mean that in the most affectionate way 🫢


🌈 PERL VERSION 🌈

this module should work on any version of perl still receiving updates from the Perl 5 Porters. translation: any version of perl released in the last two to three years. (that is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) πŸ’€

and now the caveat, listen up:

although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so don't come for the maintainers with your ancient perl, okay? 😭

🫢 THANKS 🫢

  • Simon Cozens (SIMON) β€” for encouraging me to release it, and for Email::Simple and Mail::Thread. king behaviour fr fr πŸ‘‘
  • Richard Clamp (RCLAMP) β€” for the header patch. the way that patch came through?? ate. πŸ“

πŸ¦‹ SEE ALSO πŸ¦‹

perl, Mail::Thread, Email::Simple

go read them, they're the supporting cast and they deserve their flowers 🌸


πŸ’œ AUTHOR πŸ’œ

Iain Truskett <spoon@cpan.org>


⭐ CONTRIBUTOR ⭐

Ricardo Signes <rjbs@semiotic.systems>


this software is copyright (c) 2003 by Iain Truskett <spoon@cpan.org>.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go forth, remix, redistribute β€” legally, bestie πŸ’…


and that's the page!! πŸ’– this was perl v5.36.0, dated 2022-11-21, and it's the Email::Thread(3pm) page. thread your mail, dump your trees, stay hydrated, periodt. 🌈✨🧚

πŸ“¦ where this page comes from