Fast(3pm)

πŸ“¦
version 0.19 Β· 2 versions
  • 0.19 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.19 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Module::Pluggable::Fast β€” it's giving fast plugins with instantiation ✨

Like, Module::Pluggable but the plugins get built the second they're spotted. Bestie, it's for code generators β€” think Class::DBI::Loader energy 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

No cap, this is literally the whole thing:

package MyClass;
use Module::Pluggable::Fast
  name   => 'components',
  search => [ qw/MyClass::Model MyClass::View MyClass::Controller/ ];

package MyOtherClass;
use MyClass;
my @components = MyClass->components;

See how MyOtherClass just... calls components on MyClass and gets the whole squad back? Iconic. πŸ’…


🌸 DESCRIPTION 🌸

Okay so. Module::Pluggable::Fast is basically Module::Pluggable's cooler cousin β€” except instead of just finding plugins and leaving them sitting there, it instantiates them the moment they're found. Immediately. No waiting. Main character energy πŸ”₯

And why do we care? Because code generators like Class::DBI::Loader need that β€” they want the plugin object right now, not a promise of one later. Periodt.


✨ OPTIONS ✨

  • name β€” the name for the exported method. Defaults to plugins. Yeah, plugins, lowercase, that's the one. πŸŽ€
  • require β€” if it's true, you only require the plugins. That's it, that's the whole vibe. No instantiation, just the require. πŸ™ˆ
  • callback β€” a coderef to be called instead of the default instantiate callback. So like, you get to swap in your own behaviour, slay. πŸ’œ
  • search β€” an arrayref holding a list of namespaces to go hunting for plugins in. Defaults to the ::Plugin:: namespace of the calling class. So if nobody tells it where to look, it just checks your own class's ::Plugin:: corner of the world. 🧚

πŸ‘‘ AUTHOR πŸ‘‘

Sebastian Riedel, sri@cpan.org β€” king behaviour, honestly. 🌈


This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. Free as in freedom, bestie. πŸ’–


⭐ SEE ALSO ⭐

  • Module::Pluggable β€” the OG, the blueprint, the blueprint that this one ran with πŸ¦‹

And that's the whole page, gorgeous. This was pulled from the User Contributed Perl Documentation, perl v5.36.0, dated 2022-12-08 β€” so go forth, instantiate some plugins, and stay fabulous πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from