On Wednesday 20 April 2005 04:24, Jay Savage wrote: > What does your current code look like, and what errors is it > returning. Well, it's not returning any errors because I can't get it to the point where it can run, because I'm not sure how to go about this. Some of what I currently have looks like:
package PluginMgr; use Module::Pluggable instantiate => 'new'; # Create a new plugin manager instance. Parameters: # pluginDir => the path to find the plugins to load # stateDir => the path plugins can store state data to # debug => should extra debugging info be displayed? This is passed # on to plugins sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { pluginDir => 'plugins', stateDir => 'pluginstate', debug => 0, callbacks => { }, @_, }; mkdir $self->{stateDir} if (! -d $self->{stateDir}); my $me = bless $self, $class; # Want to load all the .pm files in pluginDir now return $me; } [other methods are here] > From the docs, it looks at though most of what you need is > evaluated at runtime: "The method search_path is exported into you > namespace as well. You can call that at any time to change or replace > the search_path." Hmm, it looks like I overlooked that when I read the docs earlier, thanks for pointing it out :) Hopefully it does the trick. > If you're designing it, you can also make the paths > relative, and tell your users what directory they have to keep modules > in. Most applications that allow plugins do this. erk, no. I don't like that. I mean, if it was installed on a system someone might want plugins in /var/lib/..., but someone running it in their home dir might be happy with a relative './plugins'. And so I want it to be specified in a config file. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
pgpGSN00MIClR.pgp
Description: PGP signature