CPANPLUS::Error(3pm)
π CPANPLUS::Error β error handling for CPANPLUS π
okay bestie, welcome to the manual page for CPANPLUS::Error (3pm) β yes she's a Perl module, yes she's from the User Contributed Perl Documentation era, and yes she's lowkey carrying the entire CPANPLUS emotional support system. sit down, grab a strawberry, let's get into it πβ¨
β¨ SYNOPSIS β¨
the whole vibe, in one line:
use CPANPLUS::Error qw[cp_msg cp_error];
that's it. that's the entry point. iconic behavior honestly π
πΈ DESCRIPTION πΈ
so basically? this module is the error handling code for all the CPANPLUS libraries. she's the one catching feelings β sorry, catching errors β behind the scenes.
fr fr though: this is mainly intended for internal use. she's not out here begging for attention, she's just doing her job in the background like the main character she is. π
π¦ FUNCTIONS π¦
π cp_msg("message string" [,VERBOSE])
records a message on the stack π β and if the VERBOSE option is true, she also prints it to STDOUT (or, actually, to $MSG_FH β peep the GLOBAL VARIABLES section below, iykyk).
heads up: VERBOSE defaults to false. so by default she's silent. mysterious. respectful of your terminal space. β¨
π msg()
just an alias for cp_msg. same girl, shorter name. π«Ά
π cp_error("error string" [,VERBOSE])
records an error on the stack π and, if VERBOSE is true, prints it to STDERR (or actually to $ERROR_FH β again, see the GLOBAL VARIABLES sections below).
and here's the plot twist: VERBOSE defaults to true for this one. errors wanna be SEEN. errors wanna be HEARD. errors are not shy. π
π error()
an alias for cp_error. twin energy. π
π CLASS METHODS π
β CPANPLUS::Error->stack()
retrieves all the items on the stack. since CPANPLUS::Error is implemented using Log::Message, you gotta consult its manpage for the function retrieve to see what actually gets returned and how to use the items. no gatekeeping, just go read it bestie π
β CPANPLUS::Error->stack_as_string([TRACE])
returns the whole stack as a printable string π. if the TRACE option is true, all the items come back with Carp::longmess output rather than just the message β like, full receipts, full lore, full context.
TRACE defaults to false. keep it chill by default. πΈ
β CPANPLUS::Error->flush()
removes all the items from the stack and returns them. clean slate, fresh start, new era π
. and yep β since CPANPLUS::Error is implemented using Log::Message, consult its manpage for the function retrieve to see what is returned and how to use the items. same deal as stack(), different energy.
π GLOBAL VARIABLES π
$ERROR_FHβ this is the filehandle that all the messages sent toerror()get printed to. defaults to*STDERR. π¨$MSG_FHβ this is the filehandle that all the messages sent tomsg()get printed to. defaults to*STDOUT. π¬
π§ a lil sign-off π§
and that's the whole page, bestie!! this one came from perl v5.40.1, dated 2025-03-01, and it's filed under CPANPLUS::Error(3pm). go forth and handle your errors with grace, drama, and impeccable filehandle choices. periodt πβ¨π¦
π¦ where this page comes from
- debian trixie: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms