1App::Rad::Plugin(3) User Contributed Perl Documentation App::Rad::Plugin(3)
2
3
4
6 App::Rad::Plugin - Extend the App::Rad framework!
7
9 This document is intended to help developers write their own App::Rad
10 plugins. For specific usage on any given plugin, please refer to it's
11 actual documentation.
12
14 Since the plugin API is very new, there might be some changes in the
15 future. Please drop me an email or RT wishlist if you feel something
16 can be done to make plugin creation even better. Thanks!
17
19 Creating App::Rad plugins is very easy.
20
21 package App::Rad::Plugin::MyPlugin;
22
23 and create your subs as if they were methods of the App::Rad's $c
24 variable.
25
26 sub newmethod {
27 my $c = shift;
28
29 # ...
30 }
31
32 If a user invokes your plugin, she can use your new methods at any
33 point in their program:
34
35 use App::Rad qw(MyPlugin);
36 App::Rad->run();
37
38 sub default {
39 my $c = shift;
40
41 $c->newmethod(); # this works!
42 }
43
44 you can also extend App::Rad's functionality by overriding methods,
45 such as "getopt" or "config".
46
48 App::Rad will only import methods not starting with an underscore:
49
50 package App::Rad::Plugin::YetAnother;
51
52 sub something {
53 my $c = shift;
54
55 _internal( $c->stash->{somevalue} );
56 }
57
58 sub _internal {
59 my $value = shift;
60 #...
61 }
62
63 So you can safely create several internal subs for your plugin.
64
65 use App::Rad qw(YetAnother);
66
67 sub default {
68 my $c = shift;
69
70 $c->something() # this works!
71
72 $c->_internal() # this won't...
73 }
74
76 Currently there are no reserved names for your plugin subs. However,
77 they might be added in the future to be called on some predefined times
78 in the App::Rad command workflow. Let me know if you feel this would
79 improve your plugin's usability. Thanks!
80
82 You can find documentation for this module with the perldoc command.
83
84 perldoc App::Rad::Plugin
85
87 Breno G. de Oliveira, "<garu at cpan.org>"
88
90 Lots of thanks to Fernando Correa (FCO) for his help with this module.
91
93 Copyright 2009 Breno G. de Oliveira "<garu at cpan.org>". All rights
94 reserved.
95
96 This module is free software; you can redistribute it and/or modify it
97 under the same terms as Perl itself. See perlartistic.
98
100 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
101 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
102 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
103 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
104 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
105 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
106 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
107 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
108 NECESSARY SERVICING, REPAIR, OR CORRECTION.
109
110 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
111 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
112 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
113 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
114 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
115 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
116 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
117 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
118 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
119 DAMAGES.
120
121
122
123perl v5.34.0 2022-01-20 App::Rad::Plugin(3)