You make a lovely teddy bear

Yitzchak Scott-Thoennes sthoenna at gmail.com
Thu Mar 27 16:58:15 GMT 2014


On Thu, Mar 27, 2014 at 9:37 AM, David Cantrell <david at cantrell.org.uk> wrote:
> I found this, in the import() method of the module that was
> loading my module:
>
>   sub import {
>       [page of weirdness]
>
>   --> local $Exporter::ExportLevel = 1; <--
>
>       [page of weirdness]
>
>       require My::Module;
>       My::Module->import();
>   }

I think what's actually wanted there would be:

sub import {
    ...
    require My::Module;
    My::Module->export_to_level(1);
}

though it's not completely clear to me that that will automatically
use @My::Module::EXPORT - you may have to pass it as the third
parameter to export_to_level.


More information about the london.pm mailing list