chenhonkhonk has asked for the wisdom of the Perl Monks concerning the following question:
I have what sounds to me like a simple problem. I want to use a different 'package' in a module for brevity, and I want to export things in the normal package namespace. If I include the package My::foo; alone, my functions and variables export with @EXPORT_OK and our @EXPORT. Perfectly fine no problems. If I then put package barpackage; somewhere for making all the functions/variables not have barpackage::otherpackagestuff:: in front for the sub-package, all my exports are not found. I'm used to C just having extern or include'ing, and not needing to have tricks and hacks just so I can export things without typing 5x the characters for any value/function.
I know it's "bad" programming to pollute a namespace, but it shouldn't be a broken kludge of the language to stop me from overlapping namespaces at all.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Export and use different package in module
by haukex (Archbishop) on Feb 22, 2019 at 19:00 UTC | |
by chenhonkhonk (Acolyte) on Feb 22, 2019 at 20:24 UTC | |
by haukex (Archbishop) on Feb 22, 2019 at 20:38 UTC | |
by chenhonkhonk (Acolyte) on Feb 22, 2019 at 20:54 UTC | |
by haukex (Archbishop) on Feb 22, 2019 at 21:11 UTC | |
|