in reply to Re: Is this safe to export and import functions this way?
in thread Is this safe to export and import functions this way?
UPDATE: Also I wanted to ask, if I use strict and warnings in the main script, is that in the modules scope as well, or do I need to use strict and warnings in the module as well?
'use strict' is a pragma that has lexical scope. Loading a module via use loads the module via require which notes "The file is included via the do-FILE mechanism, which is essentially just a variety of eval with the caveat that lexical variables in the invoking script will be invisible to the included code". So a lexical pragma will also not stay in effect.
So you need to 'use strict;' in each module.
- tye
|
|---|