Skip to content

Commit

Permalink
Avoid double-require bug Module::Pluggable induces.
Browse files Browse the repository at this point in the history
Because `use Color::Library` invokes before the library finishes ....
 -which does that `use Module::Pluggable` and loads all its plugins before the library finishes
 -which involves invoking appropos of

      Foo.pm

      require Foo;

      1

and that has the side effect that the subs are compiled twice :/

So this hacks around this by invoking `use Moo` first, which sets
$INC{C/L/D/XKCD} = 1

And that prevents require attempting to require it a second time.
  • Loading branch information
kentfredric committed Mar 8, 2015
1 parent 2c12993 commit cef6b43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Color/Library/Dictionary/XKCD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ our $VERSION = '1.000000';

# AUTHORITY

use Color::Library 0.021;
use Moo qw( extends );
use Color::Library 0.021;
use File::ShareDir qw( dist_file );
extends 'Color::Library::Dictionary';

Expand Down

0 comments on commit cef6b43

Please sign in to comment.