darren chamberlain <[EMAIL PROTECTED]> wrote:
>James G Smith <[EMAIL PROTECTED]> said something to this effect on 07/02/2001:
>> How would something like this do:
>> 
>> NAME
>> 
>> Apache::Use
>> 
>> SYNOPSIS
>> 
>> use Apache::Use (Logger => DB, File => "/www/apache/logs/modules");
>> 
>> DESCRIPTION
>> 
>> Apache::Use will record the modules used over the course of the 
>> Perl interpreter's lifetime.  If the logging module is able, the 
>> old logs are read and frequently used modules are automatically 
>> loaded.  Note that no symbols are imported into packages.
>
>You can get this information from %INC, can't you? e.g.:

Most definitely.  However, you lose information about which 
modules are needed more often than others.  There's no difference 
between all scripts needing CGI.pm and one script needing 
Foo::Bar.  

We also lose timing information.  If 90% of the modules are 
loaded into the process with the last request before the child is 
destroyed, there's no point in loading them during the 
configuration phase.  We can help this a little by taking 
snapshots of %INC at regular intervals (at the end of each 
request, for example).

The current code I have uses %INC, but I wanted to write
something like the following:

sub use : immediate {
  # do stuff here if logging
  return CORE::use(@_);
}
-- 
James Smith <[EMAIL PROTECTED]>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix

Reply via email to