rashley has asked for the wisdom of the Perl Monks concerning the following question:
Portability is an issue, so I'm doing my best to create a config file that will contain anything that may change in order to move the code.
I've managed this, with one exception. My scripts all use a common package. In order to get this into @INC I've been doing something like this:
And it works fine. Now I'm trying to get this path into my config file like such:use strict; use lib '/my/path/'; use PackageName; our ( $var1, $var2); require Config;
And it doesn't work. I know that this is because 'use lib' is a compile-time command, which is causing problems.our ( $var1, var2, $myPath); require SCP_Config; use lib $myPath; use PackageName;
Still, there must be a way to do this. Any ideas?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dynamic Package Loading
by ikegami (Patriarch) on Dec 16, 2005 at 20:23 UTC | |
|
Re: Dynamic Package Loading
by BrowserUk (Patriarch) on Dec 16, 2005 at 20:25 UTC | |
by rashley (Scribe) on Dec 16, 2005 at 20:39 UTC | |
by BrowserUk (Patriarch) on Dec 16, 2005 at 21:02 UTC | |
by rashley (Scribe) on Dec 19, 2005 at 19:05 UTC | |
by rashley (Scribe) on Dec 19, 2005 at 18:20 UTC |