P is for Practical | |
PerlMonks |
Re^4: How to import "global" variables into sub-scripts from main script?by Polyglot (Chaplain) |
on Mar 22, 2021 at 10:25 UTC ( [id://11130094]=note: print w/replies, xml ) | Need Help?? |
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~
In Section
Seekers of Perl Wisdom
|
|