in reply to Exporter problem
First, lexical variables cannot be exported. Use our $test="hello" instead.
Secondly, the name Config is somewhat unfortunate, because there's a core module of the same name, which you will likely load instead of your own...
Update: to elaborate on the latter point: the use lib "$FindBin::Bin"; doesn't achieve the desired effect here, because use lib itself already loads Config.pm, so your own subsequent use Config just does nothing, because the (core) module is already loaded. In theory, you could work around that problem (in this particular case) by saying
BEGIN { unshift @INC, $FindBin::Bin }
but it's probably a better idea to choose a different name, in order to avoid such pitfalls right from the start... (What if some other module you load later should need the core module's functionality after you've successfully manoeuvred your own module into the Config namespace?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exporter problem
by saintex (Scribe) on Jun 03, 2010 at 17:15 UTC | |
by saintex (Scribe) on Jun 03, 2010 at 20:04 UTC | |
by almut (Canon) on Jun 03, 2010 at 20:17 UTC | |
by saintex (Scribe) on Jun 04, 2010 at 06:18 UTC | |
by almut (Canon) on Jun 04, 2010 at 08:43 UTC | |
by saintex (Scribe) on Jun 04, 2010 at 09:56 UTC | |
by saintex (Scribe) on Jun 04, 2010 at 20:21 UTC |