Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I was wondering if it is possible to create a global function.
(By global I mean a function that is available in all namespaces)
What I would like to be able to do is:
use Some::Module 'function'; function "..."; package Another::Module; function "..."; package Yet::Another::Module; function "..."; ...
Is this possible? (without importing the function in each package?)
The modules/packages in which the modules is used is not know in front so it is not possible to export them at the start...
So far I've tried to export the function to the CORE::GLOBAL package and to the CORE package but this did not gave the result I want...
Anyone know if this is possible? and/or where I can read about it? and/or how to do it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating a global function
by ambrus (Abbot) on Sep 06, 2004 at 18:26 UTC | |
|
Re: Creating a global function
by Zaxo (Archbishop) on Sep 06, 2004 at 15:36 UTC | |
by Anonymous Monk on Sep 06, 2004 at 16:09 UTC | |
|
Re: Creating a global function
by rinceWind (Monsignor) on Sep 06, 2004 at 15:41 UTC | |
by PodMaster (Abbot) on Sep 06, 2004 at 15:45 UTC | |
by broquaint (Abbot) on Sep 07, 2004 at 04:51 UTC | |
by ambrus (Abbot) on Sep 10, 2004 at 08:12 UTC |