Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl and compile time module loading

Tags:

module

perl

probably a weird question, but bear with me (-: when Perl loads a module using 'use', this is a compile time directive, and assuming this module doesn't use 'require' anywhere in this module, can I launch a script which 'uses' that module and while the script ruins erase the module from the HDD and be sure that the module is all loaded into the memory? (can call all of its methods and such...)

Thanks,

like image 853
snoofkin Avatar asked May 03 '26 12:05

snoofkin


1 Answers

Yes, you can. Perl compiles sources into internal data structure (parse tree) before running it, and it doesn't work with .pm files at runtime. So removing modules from disk is safe after the script has been compiled and successfully launched.

like image 130
nab Avatar answered May 05 '26 08:05

nab