Agent:...r::Mail(3pm)
π Agent:...r::Mail β the perl manpage, bestie edition
okay so bestie, we're looking at Agent:...r::Mail(3pm), which lives in the User Contributed Perl Documentation section of your perl manual. Sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
Log::Agent::Driver::Mail β it's the email driver for Log::Agent. That's it, that's the whole vibe. π§π
πΈ SYNOPSIS πΈ
Here's the whole thing, verbatim, no notes:
use Log::Agent;
require Log::Agent::Driver::Mail;
my $driver = Log::Agent::Driver::Mail->make(
-to => 'oncall@example.org',
-cc => [ qw( noc@example.org admin@example,net ) ],
-subject => "ALERT! ALERT!",
-mailer => [ 'smtp', Server => 'mail.example.net' ]
);
logconfig(-driver => $driver);
yes the admin@example,net is a comma, and yes we are preserving it exactly, because that's what the source says and we don't rewrite other people's addresses here π«‘
π¦ DESCRIPTION π¦
So what does this driver do, bestie? It takes all your logxxx() calls and maps them to email messages. Every single call gets its own separate email message. Not batched. Not bundled. One call, one email, every time. π
β οΈ heads up: theMail::Mailermodule is required. You can't run this without it, fr fr. NoMail::Mailer, no mail, no slay.
π CONSTRUCTOR π
π make OPTIONS
The OPTIONS argument is a hash with the following keys:
-prefixβ an optional prefix for the message body. Cute little intro for your email, if you want one. β¨-toβ the destination addresses. This can be a scalar holding one valid email address, or a reference to an array of addresses. Your call. π-reply_toβ the reply-to addresses. Same deal as above: a scalar with one valid email address, or an array reference with many. π¬-fromβ the source address. This one must be a scalar containing a valid email address β no array refs allowed here, bestie, it's a one-address situation. π«Ά-subjectβ the subject line of the email message. Make it iconic. π-ccβ the carbon copy addresses. Scalar with one valid email address, or a reference to an array of addresses. π-bccβ the blind carbon copy addresses. Scalar with one valid email address, or a reference to an array of addresses. π€«-priorityβ the priority level for the email message. π¨ And listen: this is NOT related to the logging priority. Different thing entirely. Don't mix them up.-mailerβ a reference to an array containing the optional arguments toMail::Mailer->new(). Generally you can just omit this one. lowkey optional, highkey handy when it's not. β¨
π NOTES π
Thanks to Shirley Wang for the idea for this module. shoutout π«Άβ¨
π AUTHOR π
Mark Rogaski <mrogaski@pobox.com> β the icon, the legend. π
π LICENSE π
Copyright (C) 2002 Mark Rogaski; all rights reserved.
See Log::Agent(3) or the README file included with the distribution for license information. (go read it bestie, it's right there π)
π₯ SEE ALSO π₯
Mail::MailerLog::Agent::Driver(3)Log::Agent(3)
and that's the page, bestie π no cap, you now know everything there is to know. This was perl v5.36.0 from 2022-10-15 β literally the source of the whole vibe. go log something and mail it, you main character ππ¦π
π¦ where this page comes from
- ubuntu noble: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- ubuntu resolute: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- ubuntu stonking: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms