ingydotnet/perl5-pm — Issue #1: doesn't work with things that use Exporter
Author: barefootcoder
Created: 2012-01-27 02:30:21+00:00
State: open

First of all, let me just say that this module is brilliant. I was using `Toolkit` before, but this is much cooler.

Now, on to my problem.

If the module I include in `imports` has its own import, it works fine. If it uses `Sub::Exporter` it works fine. But if it uses `Exporter`, it doesn't work. That is, the module is loaded, but the exports never make it back to the calling script. I've added some debugging to `Exporter` and `Sub::Exporter` and here's what I can see:

With `Const::Fast` (uses `Sub::Exporter`):

[winterfell:~] perl -Mperl5-barefoot -le 'print dir()->absolute' | & grep Const::Fast
in package Scalar::Util calling package is Const::Fast
in package Carp calling package is Const::Fast
in package Sub::Exporter calling package is Const::Fast
in package Storable calling package is Const::Fast
in package Const::Fast calling package is main

But with `Path::Class` (uses `Exporter`):

[winterfell:~] perl -Mperl5-barefoot -le 'print dir()->absolute' | & grep Path::Class
in package Exporter calling package is Path::Class
in package Cwd calling package is Path::Class::Entity
in package Carp calling package is Path::Class::File
in package Path::Class calling package is Hook::LexWrap

So obviously it's just exporting to the wrong namespace. Now, I think I understand _basically_ how `perl5` works, but I don't think I understand quite well enough to be able to fix it. Perhaps if you gave me a nudge in the right direction I could come up with a patch?

Thanks again for all you do for Perl. Some of my favorite modules are Ingy modules. :-)