Bill Catlan wrote:
Cees, So a plugin author would use base CGI::Application::Plugin; in their plugin, and that would be it?
That is the first part, the second part is to mark which methods you want automatically exported to the class that is 'use'ing the plugin, and that is done using a subroutine attribute:
sub auth : CGIAppPluginMethod {
my $self = shift;
# do some cool stuff
}
sub _private_auth {
# so some more cool stuff
}
In this case the 'auth' method would be exported and made available, but
the _private_auth method would not.
This way you can still keep some methods private in the plugin. All the C::A::Plugin module does is look for all subroutines that have the CGIAppPluginMethod attribute set and exports them to the callers namespace.
Separately, how would a CGI::Application app author get access to the plugin methods? What makes the Plugin available to the CGI::Application app - CGI:Application (though you said no mod to C::A code) or else the C::A app itself?
In any of your CGI::Application modules, you just 'use' the plugin!
package My::CGIApp;
use base qw(CGI::Application)
use CGI::Application::Session;
That's it...
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.