App::Rad::Plugin(3pm)
πΈ App::Rad::Plugin β the manual page, bestie edition π
okay so this is App::Rad::Plugin, straight out of the User Contributed Perl Documentation β¨ it's the glow-up guide for extending the App::Rad framework β think of it as the "how to build ur own plugin" bible π
β¨ NAME β¨
App::Rad::Plugin β Extend the App::Rad framework! π no cap, that's the whole point.
π¦ SYNOPSIS π¦
This doc is for developers who wanna write their own App::Rad plugins. That's it, that's the assignment π«Ά if u just want to use some existing plugin, go read that plugin's actual documentation instead, bestie. iykyk.
π WARNING! π
The plugin API is very new, and ngl there might be some changes in the future π so pls don't come for me.
If u feel like something could be done to make plugin creation even better β like fr fr better β drop me an email or an RT wishlist. Thanks bb ππ
π PLUGIN CREATION BASICS π
Creating App::Rad plugins is very easy. Periodt.
Just start with this:
package App::Rad::Plugin::MyPlugin;
then write ur subs as if they were methods of App::Rad's $c variable π like:
sub newmethod {
my $c = shift;
# ...
}
So when a user invokes ur plugin, she can call ur new methods at literally any point in her program π
use App::Rad qw(MyPlugin);
App::Rad->run();
sub default {
my $c = shift;
$c->newmethod(); # this works!
}
and you can also extend App::Rad's functionality by overriding methods, like getopt or config π
that's the main character move.
π§ CREATING INTERNAL (HELPER) SUBS π§
App::Rad will only import methods not starting with an underscore. so subs named _whatever are ur lil private helpers, lowkey invisible to the outside world π«Ά
package App::Rad::Plugin::YetAnother;
sub something {
my $c = shift;
_internal( $c->stash->{somevalue} );
}
sub _internal {
my $value = shift;
#...
}
So u can safely create several internal subs for ur plugin πΈ no drama.
use App::Rad qw(YetAnother);
sub default {
my $c = shift;
$c->something() # this works!
$c->_internal() # this won't...
}
heads up bestie: see that last one? $c->_internal() does NOT work. underscore subs stay private. that's the vibe check and it passed π
π RESERVED SUB NAMES π
Currently there are no reserved names for ur plugin subs. iconic. free real estate π
But β plot twist β they might be added in the future, to be called at some predefined times in the App::Rad command workflow π so like, stay tuned. Let me know if u feel this would improve ur plugin's usability. Thanks! π
π SUPPORT π
You can find documentation for this module with the perldoc command π
perldoc App::Rad::Plugin
that's it, that's the support β¨
β AUTHOR β
Breno G. de Oliveira, <garu at cpan.org> π«Ά the legend herself.
π ACKNOWLEDGEMENTS π
Lots of thanks to Fernando Correa (FCO) for his help with this module π bestie behavior fr fr.
πΈ LICENSE AND COPYRIGHT πΈ
Copyright 2009 Breno G. de Oliveira <garu at cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
π DISCLAIMER OF WARRANTY π
okay this part is in ALL CAPS for a reason, bestie, pls actually read it π
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
and that's the whole page, bestie π this beauty shipped with perl v5.36.0 and landed on 2022-10-13 β go forth and write plugins, u got this π¦β¨π
π¦ where this page comes from
- ubuntu noble: libapp-rad-perl 1.05-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libapp-rad-perl 1.05-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libapp-rad-perl 1.05-4 Β· 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