OK, I now have:
package PluginMgr;

use strict;
use warnings;

use Module::Pluggable instantiate => 'new';
our @ISA=("Module::Pluggable");

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;
    $me->search_path(new => $me->{pluginDir});
    print "Loading plugins\n" if ($me->{debug});
    my @plugins = plugins($me, $self);
    print "Loaded plugins: @plugins\n" if ($me->{debug});
    return $me;
}

However, when it tries to run the line:
$me->search_path(new => $me->{pluginDir});
I get: Can't locate object method "search_path" via package "PluginMgr" at 
PluginMgr.pm line 30.

however, according to:
http://search.cpan.org/dist/Module-Pluggable/lib/Module/Pluggable.pm#METHODs
I should be able to do this. Note that I'm using the Debian packaged 
version of Module::Pluggable which is a version or two behind. To see if 
that was the problem, I copied Pluggable.pm from the latest tarball, and 
then specified 'use Pluggable ...', but the same thing results.

Any thoughts?

-- 
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

Attachment: pgptjQIj6NylP.pgp
Description: PGP signature

Reply via email to