Slash Boxes
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 ]

tokuhirom (7396)

  (email not shown publicly)

Journal of tokuhirom (7396)

Thursday May 29, 2008
09:32 PM


[ #36547 ]

I want to use Plagger style plugins architecture with Moose.Therefore, I created MooseX::Plaggerize!

svn repos is here:


    # in main

    my $c = Your::Context->new;
    $c->load_config('config.yaml'); # feature of MooseX::Plaggerize::ConfigLoader
    $c->load_plugin({module => 'HTMLFilter::DocRoot', config => { root => '/mobirc/' }});

    package Your::Context;
    use Moose;
    with 'MooseX::Plaggerize', 'MooseX::Plaggerize::ConfigLoader';

    sub run {
        my $self = shift;

        $self->run_hook('response_filter' => $args);

    package Your::Plugin::HTMLFilter::StickyTime;
    use strict;
    use MooseX::Plaggerize::Plugin;

    hook 'response_filter' => sub {
        my ($self, $context, $args) = @_;


* Plugin architecture like Plagger
* Each plugin has own instance
* Each plugin can have own configuration

### What's difference with MooseX::Object::Pluggable?

yeah, I know MooseX::Object::Pluggable, ofcource.

MooseX::Object::Pluggable stands on Moose::Role and method modifiers.This is cool architecture.

But, this approach cannot use configuration like Plagger :(

therefore, I wrote MooseX::Plaggerize :)

### ...

We would like to hear from you
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • There is a MooseX::Object::Pluggable [] on CPAN which the synopsis suggests does almost exactly the same thing as your module – and as a bonus, it has a much better name. For config loading there are already MooseX::ConfigFromFile [] and MooseX::SimpleConfig []. Do none of these do what you need/want?

    • "MooseX::Plaggerize instanciates each plugins, and each plugin has own configuration" is core concept of MooseX::Plaggerize.MooseX::Object::Pluggable is not matched to this use case.

      and, configuration file loader is not a key feature, that is trivial :)
      • hmm... please read source.
      • Ah, I see, OK.

        You still need a better name though – even someone who knows what Plagger is would have no idea what “Plaggerize” means until you tell them. It’s pretty much as if you had called the module MooseX::FooBaz.

        How about MooseX::Hookable? That seems to describe the functionality you want to offer.

  • Sometimes, when I realize I can reuse something I liked in more places, I get too excited and act like everyone should like what I've done. So maybe you should ignore this.

    I recently uploaded Config::INI::MVP::Reader, which I use in a few things to initialize plugins based on configuration. You might find it useful for doing some similar, simple things with Plaggerize.

    Every time I see Plaggerize in the RSS feed, I think "plagarize." :-)