in reply to Dynamic exports with Exporter::Easy
Hello wanna_code_perl,
Note that use MODULE LIST is equivalent to BEGIN { require MODULE; MODULE->import( LIST ); }; so, if you have:
use Exporter::Easy ( OK => [ keys %subs ], TAGS => all => [ keys %subs ], ], );
the implicit BEGIN block invokes a reference to the %subs hash before it has been initialised. Changing to require works for me (i.e., it passes your test script with either use Foo qw/subA subB Abus Bbus/; or use Foo ':all';):
require Exporter::Easy; Exporter::Easy->import( OK => [ keys %subs ], TAGS => [ all => [ keys %subs ], ], );
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamic exports with Exporter::Easy
by wanna_code_perl (Friar) on Oct 22, 2019 at 05:53 UTC |