in reply to How to access main package global vars in modules
There are several alternative one line changes that do what you ask, such as:
- Declare $glbA and $glbB with our in functions.pl
- Refer to those variables in functions.pl with the fully qualified $main::glbA and $main::glbB
- no strict "vars"
But none of the above is recommended. You would be much better in most scenarios to make functions.pl a package, and pass lexical variables as parameters to its functions.
|
---|
In Section
Seekers of Perl Wisdom