Test::...Plugin(3pm)
β¨ 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
- ubuntu stonking: libtest-mockfile-perl 0.039-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