Paul Johnston wrote: > Cees Hek wrote: > >> All you need to do is export a 'blog' method from your >> MyApp::Plugin::Blog plugin. This can be done quite easily using the >> Exporter module. Here is a quick example of what you would put in >> your plugin: >> > > > I'd got this far, but what I was confused about is what is returned? > > ie if I want to call: > > $self->blog->getBlog($blogid); > > where is getBlog created?
Your blog() method would do what ever you want it to do. In this case it looks like you want it to return some sort of object. So it needs to create this object. You can store these objects (or anything else your plugin needs) throughout the request in the $self object's hash. The "Writing Plugins" section of the pod mentions how to best do this - http://search.cpan.org/~markstos/CGI-Application-4.04/lib/CGI/Application.pm#Writing_Plug-ins -- Michael Peters Developer Plus Three, LP --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
