Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of LTjake (4001)

Thursday August 26, 2004
06:58 AM

PAR and Module::Pluggable

[ #20576 ]

Unfortunately, I had to submit a bug report yesterday. PAR and Module::Pluggable do not play well together. In theory this test should pass:

package MyApp;

use PAR qw( plugins/*.plugin );
use Module::Pluggable;

sub new {
    my $class = shift;
    return bless { }, $class;
}

package main;

use Test::More tests => 1;

my $app = MyApp->new;

is( ( $app->plugins() )[ 0 ], 'MyApp::Plugin::Test' );

Note: there should be a plugins/test.plugin file which is really just a PAR file (which is really just a zip file). It should house the MyApp::Plugin::Test module.

This doesn't work because PAR does some lazy loading and when Module::Pluggable checks @INC, nothing is there. You can work around this by adding a require MyApp::Plugin::Test; just about anywhere -- but that sort of defeats the purpose.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.