in reply to does perl cache between invocations?

Perl doesn't cache anything. That's why things like mod_perl and PPerl are useful. What you're seeing is your OS caching files, which is a standard feature of any modern filesystem.
  • Comment on Re: does perl cache between invocations?

Replies are listed 'Best First'.
Re^2: does perl cache between invocations?
by punkish (Priest) on Jul 15, 2006 at 20:58 UTC
    
    > What you're seeing is your OS caching files, 
    > which is a standard feature of any modern filesystem.
    

    Interesting... I wonder what this filesystem is looking at to determine that my Perl script doesn't need another roundtrip to the hard disk. After all, afaik, my script is compiled to some kind of bytecode... I wonder if the OS is looking at the signature of the bytecode, coupling it with the request for files, and saying to itself, "Aha! this fellow just asked me for the same file... let me hand it to him from the cache..."

    --

    when small people start casting long shadows, it is time to go to bed
      It's much lower level than that. The OS knows whether or not anything has tried to write to that part of the filesystem, so if nothing has, it knows its cache of the file is still good. Perl is still compiling every time -- the opcode tree of your program is not stored anywhere between calls to it -- but the actual file access that is sped up.
      It's saying to itself, "Aha! this fellow just asked me for the same file... let me hand it to him from the cache..."


      holli, /regexed monk/