English 中文(简体)
Perl 并汇编时间模块装入
原标题:Perl and compile time module loading
  • 时间:2012-05-23 07:42:08
  •  标签:
  • perl
  • module

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...)

谢谢

最佳回答
问题回答

这将适用于在启动时完全装入的简单模块。 但请注意, 许多模块使用 < code> AUTOLOAD 特性来推迟装入重部件, 直至真正需要某些特定功能。 这些模块随后可能会从任何地方拉动所需要的源―― 由功能文件、 自己的 < code\\\ DATA> / code 区域等进行预先分割。 试图装入您已经删除的文件自然会失败。 访问自己的 < code\\ DATA* / code > 仍然有效( 虽然我无法肯定它是否在内存中装入, 或者因为 Perl 持有对脚本的开关, 防止它完全消失直到它完成 ) 。





相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签