Perl module loading and compilation

probably a strange question, but carry me (-: when Perl loads the module using "use", this is a compile time directive, and assuming that this module does not use "require" anywhere in this module, can I run the script, which "uses" this module, and while the script ruins erase the module from the hard drive and make sure that the module is loaded into memory? (can you call all its methods, etc.)

Thank,

+3
source share
2 answers

Yes, you can. Perl compiles the sources into an internal data structure ( parsing tree ) before starting, and it does not work with .pm files at run time. Therefore, removing modules from disk is safe after the script has been compiled and successfully launched.

+2
source

, . , AUTOLOAD, , - . - , __DATA__ .. , , , . __DATA__ ( , , , perl script, , ).

+1

All Articles