Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
We have several thousand pm, pl, or cgi files in one mega directory. Pareto suggests that probably only twenty percent or so are used, or get frequent use. But we don't know. It would be useful to know. My idea is to have a code repository, and an active code dir. If a file is needed, it can be pulled from the repository.

A smaller set of files would be much easier to manage in the active dir. Especially for newbies.

I'm thinking of an SQL table with one row per file access, and the access type like edited the file, ran the file, "required" or "used" the file, chmodded, etc. Maybe once a day, code could run that reads access info for each file, and moves them to or from the active code directory depending on when they were last used. Or maybe based on frequency of use, rather than last use.

So I'm wondering are there CPAN modules to assist with this? I can have the repository as part of @INC, and as files are used, a mysql row is added. Starting with 100% in the repository, after weeks of running, source files we need would be in active. The rest would be inactive and maybe even after a long term, removed. And since it sounds like this table has a potential to get large, we might have to cull old rows. A thousand files invoked a thousand times a month could be a BIG table!

I'm thinking modules that I could add to the top of every sourcefile, that signals a write to the access table. And maybe modules that help me tell what classes (pms) are actually invoked or resourced, rather than just "used" , with no real use. Or, a CPAN module that can generate an array of all use or required files in the hierarchy under the initial pl or cgi.

I'm pretty sure I can write all the functionality from scratch, but if CPAN modules exist that facilitate this function, I'm all-in. I guess in-summary I want like a meta library that tells me a bunch of things about what is running, what it's using, where it came from, maybe how many milliseconds it ran, what user ran it, etc etc.. I see potential concurrency issues with a running program that has one of it's "pm's" moved mid-run; not sure how to deal with that since we operate 24x7. And other concerns. I'm still in the dreaming stage..

Best Regards Monks!

In reply to Are there CPAN modules that can help write realtime software catalogs by misterperl

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2023-12-11 11:37 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.