Test::...Plugin(3pm)

πŸ“¦
version 0.039 Β· 4 versions
, in ubuntu stonking

✨ Test::MockFile::Plugin β€” the plugin base class bestie πŸ’…

okay so this is from the perl manual, specifically the User Contributed Perl Documentation section, and it's literally called Test::MockFile::Plugin. that's the whole title, no cap. πŸŽ€


🌸 NAME 🌸

Test::MockFile::Plugin β€” it's the Plugin base class. yeah that's it, that's the name. iconic of it honestly. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

here's how you actually make one of these, bestie:

package Test::MockFile::Plugin::YourCustomPlugin;

use base 'Test::MockFile::Plugin';

sub register {

  my ( $self ) = @_;

  # Code to setup your plugin here
  ...
}

see how cute that is?? you inherit, you write a register, you vibe. that's the whole recipe fr fr. ✨


πŸ’œ DESCRIPTION πŸ’œ

so Test::MockFile::Plugin is an abstract base class for Test::MockFile plugins. abstract means you don't just instantiate it and party β€” it's the blueprint, the template, the main character energy that all your actual plugins get built on top of. 🧚


🫢 METHODS 🫢

πŸ’– new( %opts )

okay so this is the constructor, and it's handed to every Plugin package. why? so they all have a little spot to stash their internal data. it's like giving each plugin its own lil locker at school. πŸŽ€

it takes %opts, so pass in whatever your plugin needs to keep around.

πŸ’… register

$plugin->register();

this method gets called by Test::MockFile::Plugins on imports. so you don't have to call it yourself β€” the system does it for you when the import happens. slay. 🌟


🌈 SEE ALSO 🌈

  • Test::MockFile β€” the parent situation, go read it too bestie πŸ¦‹

pro tip from your girl: since this is an abstract base class, don't come for it expecting it to do stuff on its own. it's the foundation, not the whole house. πŸ’€

and that's a wrap!! this page shipped with perl v5.40.1, dated 2026-03-27, and it's part of the User Contributed Perl Documentation collection. go forth and write plugins, you absolute legend. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from