On 4/10/06, tom arnall <[EMAIL PROTECTED]> wrote: > Is there any way to run perl - apart from apache and modperl - that avoids > having to recompile perl each time it's invoked?
Your perl binary itself isn't recompiled each time it's invoked! :-) When you start running your Perl program, the perl binary takes an instant to convert it into an internal format. That's compiling, true; it typically happens at tens of thousands of lines of source code per second, and is an insignificant portion of the overall runtime. (With rare exceptions. But don't worry much about Perl compile time unless your program has megabytes of source or is invoked hundreds of times per hour.) > Specifically, I have a > script that turns a large file into a hash variable each time it is invoked > from nedit. So, it sounds as if you wish to save the overhead cost of reading this file and building the hash. Check out Storable, or a similar module. http://search.cpan.org/~ams/Storable-2.15/Storable.pm Another way to do it would be to put your large file's data into a database, which could perhaps be queried. Or, if your data state is inherently difficult to save to disk and read back again, you could make a daemon process that keeps it in memory, along with a lightweight client process that could query the daemon. But simply using Storable will probably be enough. Good luck with it! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>