is there a way of obtaining/enumerating the names of all
modules included by a script?
the idea is to call a polymorphic Flush_All_Caches -like
method on a hierachy of related objects whose
implementing modules are dynamically included at runtime
via eval "require ThisModule";. these modules
are used by multiple scripts and run under mod_perl, so
the basic idea was to only include modules as they are
needed in order to save valuable memory (and take a small
speed hit...). ie:
foreach my $class ( enumerate_loaded_classes() )
{
$class->can('clean_up') || next;
$class->clean_up();
}
Ideally, it would be great to be able to dynamically unload
large modules after they have served their purpose. the
closest solution to this i know of is to set
Apache up with
a moderately low
MaxRequestsPerChild to expire the oldest and fattest
apache children.
d_i_r_t_y
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.