PPI::Exception(3)
π PPI::Exception β the PPI exception base class π
okay bestie, so this is PPI::Exception, from the User Contributed Perl Documentation section of the manual. it's giving "foundation of every single crash-out in PPI" energy and honestly? iconic. π
β¨ SYNOPSIS β¨
use PPI::Exception;
my $e = PPI::Exception->new( 'something happened' );
$e->throw;
PPI::Exception->new( message => 'something happened' )->throw;
PPI::Exception->throw( message => 'something happened' );
like, look at her go. three whole ways to say "something happened" and then yeet. π
πΈ DESCRIPTION πΈ
so here's the tea, fr fr: every single exception that gets thrown from inside PPI is an instance of this class, or of something derived from it. that's the whole vibe. this is the mother of all PPI exceptions and she knows it. π
π¦ METHODS π¦
π new $message | message => $message, ...
constructs and returns a shiny new PPI::Exception object. β¨
you can pass a message for the exception, and you've got options bestie β either just hand over a plain string, or do the fancy keyed thing with message => $message. either way that message is sitting there waiting for you, and you can grab it later with the message method. π
π throw
okay so this one's the main character. if you call throw on an actual PPI::Exception object, it throws that object. if you call it on the class name instead, it takes your arguments, builds a PPI::Exception out of them, and then throws that. same energy, different doorway. πͺβ¨
and here's the detail you do NOT wanna miss: every single time the object gets thrown, info from the Perl <caller(0)> call gets saved and made available through the callers method. so the receipts? always kept. π
β οΈ this method never returns. like, not "usually doesn't", not "sometimes doesn't" β never. it's gone. it threw hands and left. don't write code that expects to come back from this, bestie, because you will not. π
π message
returns the exception message that got passed to the object's constructor. and if you didn't pass one? no worries, you get a default message instead. the fallback is real and it's there for you. π«Ά
π callers
returns a listref. every element inside that listref is itself a listref of caller(0) information. π
and lowkey important: the returned listref can be empty. so don't just assume there's stuff in there β vibe check your listref first, okay? π
π SEE ALSO π
hmm, actually there's no SEE ALSO section in this one, bestie β it's a short and sweet queen. π
so yeah, that's PPI::Exception in full. π§ no cap, every exception PPI throws descends from her, she remembers her callers, and her throw is a one-way trip. slay. π₯
this page came from perl v5.42.0, dated 2026-01-17, and it's filed under PPI::Exception(3) in the User Contributed Perl Documentation. take care of her, she's the blueprint. ππΈβ¨
π¦ where this page comes from
- fedora 44: perl-PPI 1.284-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms