|
|
| No such thing as a small change | |
| PerlMonks |
Re^4: Using guards for script execution?by AnomalousMonk (Archbishop) |
| on Mar 01, 2017 at 02:08 UTC ( [id://1183231]=note: print w/replies, xml ) | Need Help?? |
|
You can include other Perl files to your heart's content, and unless you explicitly export things (from the included file (in Python, an import), you'll never be able to see them within your current namespace. Unless you fully qualify the symbol name. Package globals are truly global if fully qualified. ... useing a Perl file does not execute it, so any executable code you have in a Perl file will not be run when including it into another Perl file. ... main() code ... will not be executed or evaluated (into) when including said file in another file. Files that are use-ed (e.g., .pm files) are evaluated. That's where the necessary true return value comes from at the end of the module. File MainGuard.pm;
File execution_of_used_module_1.pl:
Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||