Mail::...ogress(3pm)
β¨ Mail::SpamAssassin::Util::Progress β progress bar support for SpamAssassin β¨
okay bestie so this little icon lives in the User Contributed Perl Documentation corner of the perl universe π
it's Mail::SpamAssassin::Util::Progress(3pm) and it is literally the glow-up your SpamAssassin scripts have been waiting for π
πΈ NAME πΈ
Mail::SpamAssassin::Util::Progress β progress bar support for SpamAssassin π¦
β¨ SYNOPSIS β¨
my $progress = Mail::SpamAssassin::Util::Progress->new({total => 100});
$msgcount = 0;
foreach my $message (@messages) {
# do something here
$msgcount++;
$progress->update($msgcount);
}
$progress->final();
like. look at that loop. she's looping AND she's updating AND she's slaying π
π DESCRIPTION π
This module implements a progress bar for use in SpamAssassin scripts and modules. It lets you create the progress bar, update it, and print out the final results of a particular run. it's giving main character energy for your terminal, no cap π«Ά
π new π
public class (Mail::SpamAssassin::Util::Progress) new (\% $args)
Description: Creates a new Mail::SpamAssassin::Util::Progress object. valid values for the $args hashref are, bestie, as follows:
total(required) β the total number of messages expected to be processed. this item is required. like, genuinely required. nototal, no bar. periodt π¨fh[optional] β you may pass in an optional filehandle. if you don't,STDERRgets used by default. so that's the default, lowercase default, fr fr πterm[optional] β the module will attempt to determine if a valid terminal exists on theSTDINfilehandle. this item lets you override that value. in case the vibes onSTDINare misleading, yk? π
π¦ init_bar π¦
public instance () init_bar()
Description: This method creates the initial progress bar and is called automatically from new. plot twist: you can also call init_bar on an existing object to reset the bar back to it's original state. it's giving factory reset but make it cute π
β update β
public instance () update ([Integer $num_done])
Description: This method is what gets called to update the progress bar. You may optionally pass in an integer value that indicates how many messages have been processed. if you do not pass anything in, then the num_done value will be incremented by one. so yes, it just adds one for you, she's thoughtful like that ππ
π final π
public instance () final ([Integer $num_done])
Description: This method should be called once all processing has finished. It will print out the final msgs per sec calculation and the total time taken. You can optionally pass in a num_done value, otherwise it will use the value calculated from the last call to update. so like, the bar has receipts. she remembers. πβ¨
also quick note bestie, that header spells the name with an ellipsis in it (Mail::...ogress) and honestly? we're not fixing it. we're honoring it. iconic behavior π
that's the whole page! π«Ά written up in User Contributed Perl Documentation for perl v5.40.1, dated 2026-07-23 β go make your SpamAssassin runs look pretty, you absolute legend, mwah π ππΈ
π¦ where this page comes from
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms