CPAN::Plugin(3pm)

πŸ’– CPAN::Plugin β€” the base class era πŸ’–

ok so this is CPAN::Plugin, bestie β€” it's the base class for CPAN shell extensions. literally the blueprint, the template, the main character that all your cute little plugins inherit from. it's giving "parent energy" fr fr ✨ (and yes, it's a Perl Programmers Reference Guide page, which is why it's sitting here being all official πŸŽ€)


✨ SYNOPSIS ✨

ok so here's the vibe β€” you make a package, you parent it up, and you define your hook:

package CPAN::Plugin::Flurb;
use parent 'CPAN::Plugin';

sub post_test {
  my ($self, $distribution_object) = @_;
  $self = $self->new (distribution_object => $distribution_object);
  ...;
}

that's it. that's the whole skeleton. post_test is where you do your thing πŸ’…


🌸 DESCRIPTION 🌸

πŸ¦‹ Alpha Status πŸ¦‹

so the plugin system in the CPAN shell? it showed up in version 2.07 and it's still considered experimental. yes bestie, experimental β€” act accordingly, don't be weird about it πŸ’€

🧚 How Plugins work? 🧚

ok so for this one you gotta go read "Plugin support" in CPAN. that's where the whole story lives. go, read, come back 🫢


πŸ’… METHODS πŸ’…

  • plugin_requires β€” returns the list of packages that the given plugin requires for functionality. this list gets evaluated using the "CPAN->use_inst" method. so like, it's the plugin's shopping list and CPAN's the one doing the checkout πŸ›’
  • distribution_object β€” get the current distribution object. that's it, that's the whole thing. iconic behaviour honestly ✨
  • distribution β€” delegatee, see below πŸ‘‡
  • distribution_info β€” delegatee, see below πŸ‘‡
  • build_dir β€” simple delegatees for misc parameters derived from the distribution. so these three are just lil shortcut girlies passing stuff through for you, no cap πŸŽ€
  • is_xs β€” predicate to detect whether the package contains XS. returns truthy/falsy vibes. it's the vibe check for XS πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

Branislav Zahradnik <barney@cpan.org> β€” the author, the legend, the icon 🌟


okay bestie that's the whole page, no notes πŸ’œ

and that's a wrap, luv u, bye~ 🌈 this was perl v5.42.3, dated 2026-11-03, aka CPAN::Plugin(3pm) β€” see u in the next manpage, mwah πŸ˜­πŸ’–

πŸ“¦ where this page comes from