in reply to Exporting all variables and subroutines using Exporter
What Exporter::Auto (no problem finding it on CPAN ...) does is check into the symbols table (a hash with the same name as the module that contains all the symbols accessible from this module) for symbols with a CODE section (ie: that are the name of a sub) and that were not imported from another module (or used to alias another name). You could work from that (by reading the source of Exporter::Auto, which is pretty short), or, if I understood correctly, and you want all your variables from OldPackage into NewPackage, just replace package OldPackage; with package NewPackage; at the top of your module, and have use OldPackage; as the first line of your second module.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exporting all variables and subroutines using Exporter
by t-rex (Scribe) on Jul 13, 2016 at 17:03 UTC | |
by hippo (Archbishop) on Jul 13, 2016 at 17:20 UTC |