.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "App::Rad::Plugin 3pm" .TH App::Rad::Plugin 3pm "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" App::Rad::Plugin \- Extend the App::Rad framework! .SH "SYNOPSIS" .IX Header "SYNOPSIS" This document is intended to help developers write their own App::Rad plugins. For specific usage on any given plugin, please refer to it's actual documentation. .SH "WARNING!" .IX Header "WARNING!" Since the plugin \s-1API\s0 is very new, there might be some changes in the future. Please drop me an email or \s-1RT\s0 wishlist if you feel something can be done to make plugin creation even better. Thanks! .SH "PLUGIN CREATION BASICS" .IX Header "PLUGIN CREATION BASICS" Creating App::Rad plugins is very easy. .PP .Vb 1 \& package App::Rad::Plugin::MyPlugin; .Ve .PP and create your subs as if they were methods of the App::Rad's \f(CW$c\fR variable. .PP .Vb 2 \& sub newmethod { \& my $c = shift; \& \& # ... \& } .Ve .PP If a user invokes your plugin, she can use your new methods at any point in their program: .PP .Vb 2 \& use App::Rad qw(MyPlugin); \& App::Rad\->run(); \& \& sub default { \& my $c = shift; \& \& $c\->newmethod(); # this works! \& } .Ve .PP you can also extend App::Rad's functionality by overriding methods, such as \f(CW\*(C`getopt\*(C'\fR or \f(CW\*(C`config\*(C'\fR. .SH "CREATING INTERNAL (HELPER) SUBS" .IX Header "CREATING INTERNAL (HELPER) SUBS" App::Rad will only import methods not starting with an underscore: .PP .Vb 1 \& package App::Rad::Plugin::YetAnother; \& \& sub something { \& my $c = shift; \& \& _internal( $c\->stash\->{somevalue} ); \& } \& \& sub _internal { \& my $value = shift; \& #... \& } .Ve .PP So you can safely create several internal subs for your plugin. .PP .Vb 1 \& use App::Rad qw(YetAnother); \& \& sub default { \& my $c = shift; \& \& $c\->something() # this works! \& \& $c\->_internal() # this won\*(Aqt... \& } .Ve .SH "RESERVED SUB NAMES" .IX Header "RESERVED SUB NAMES" Currently there are no reserved names for your plugin subs. However, they might be added in the future to be called on some predefined times in the App::Rad command workflow. Let me know if you feel this would improve your plugin's usability. Thanks! .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc App::Rad::Plugin .Ve .SH "AUTHOR" .IX Header "AUTHOR" Breno G. de Oliveira, \f(CW\*(C`\*(C'\fR .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Lots of thanks to Fernando Correa (\s-1FCO\s0) for his help with this module. .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2009 Breno G. de Oliveira \f(CW\*(C`\*(C'\fR. All rights reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE 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 \*(L"AS IS\*(R" 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.\s0 .PP \&\s-1IN 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\s0 (\s-1INCLUDING 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\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0