in reply to Re^3: How to import "global" variables into sub-scripts from main script?
in thread How to import "global" variables into sub-scripts from main script?
Update: The required sub-scripts should have failed to compile under strict. If you're using do instead of require, you should check $@ and $!.
Remember, I wasn't using strict in the sub-files before. I had assumed that when I said "use strict;" in the main file, and then was bringing in the other subroutines via "require subfile.pl;" that the "strict" had applied to the entire global context. Remember, the global variables are all correctly shared among the files--so why wouldn't strict be shared, too?
In any case, I had no issues compiling until I added "strict" to the sub-file.
I'm not using "do" anywhere in the entire script at this point.
Blessings,
~Polyglot~
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: How to import "global" variables into sub-scripts from main script?
by choroba (Cardinal) on Mar 22, 2021 at 10:28 UTC | |
by Polyglot (Chaplain) on Mar 22, 2021 at 10:35 UTC | |
by LanX (Saint) on Mar 22, 2021 at 17:00 UTC | |
Re^5: How to import "global" variables into sub-scripts from main script?
by haukex (Archbishop) on Mar 22, 2021 at 16:29 UTC | |
by LanX (Saint) on Mar 22, 2021 at 16:57 UTC |