in reply to How can I prevent a module from being added to the %INC hash?
Perhaps you should be using do instead of require or use? It does add the module to %INC, but since %INC is not checked, you can execute the "module" multiple times.
do should be used for "modules" with no package statement. require or use should be used with modules with a package statement.
# config.pl # --------- $var = 'test';
# main.pl # ------- use strict; use warnings; our $var; do 'config.pl'; print($var);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I prevent a module from being added to the %INC hash?
by jacques (Priest) on Oct 04, 2006 at 03:33 UTC | |
by ikegami (Patriarch) on Oct 04, 2006 at 04:43 UTC | |
by jacques (Priest) on Oct 04, 2006 at 07:32 UTC | |
by ikegami (Patriarch) on Oct 04, 2006 at 15:40 UTC |