in reply to Re^3: Module forwarding
in thread Module forwarding
The above demonstration seems to work where exporter is used and where it isn't and import doesn't require details about the caller. BUT: I still can't get it so that the forwarders filename is the same as the underlying pm and use "use" -- I think import get overwritten in the package namespace. (hence the introduction of ForwardSimpleModule namespace)package ForwardSimpleModule; require Exporter; @ISA = qw(Exporter); use constant FORWARDED => 'SimpleModule'; require do { FORWARDED . '.pm' }; warn; sub import { warn; my $exporter = FORWARDED . "->export_to_level(2, @_)"; my $simple = FORWARDED . "->import(@_)"; eval $exporter; eval $simple if $@; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Module forwarding
by Corion (Patriarch) on Feb 06, 2012 at 17:18 UTC |