Hello. Yet another makemaker question, i'm afraid. I'm trying to adapt simonflk's very helpful skeleton-creation script to work on a set of modules that already exists, in order that i might distribute my huge folie-de-poop cms application (what? someone made one already?) more easily. There are about 55 separate classes involved, so editing makefiles isn't very appealing.

the main question, before i get tangled up and fall over myself: is there an elegant way to get the uncompiled text of a module without having to track it down and read the file?

i began by turning simonflk's lazy-helper into a nice little script that read in the set of poop classes from the application's self-description routines - there's lots of metadata available - and passed it to Extutils::Makemaker, which created a delightfully comprehensive but completely empty module hierarchy. Oh, ok, i thought. You're supposed to do that first :(

So I've fiddled with E::M to make it use a slightly different stub and drop in the existing module code in the right place. That's all straightforward, if impertinent.

but i don't have a good way of getting hold of the module code in order to do that. at the moment i'm hardcoding a lib path, parsing the package name, reading the .pm file and extracting the relevant bits, which goes clunk in a big way.

what i'd really like is to simply use the module(s) that i'm packaging up and get everything else from there, including the text of the module itself. I would happily add a '_raw' method to each module (easy to do, as they're all subclasses), but again the only way i can think of relies on the module knowing its filesystem location, or me crawling the $PATH, which i don't fancy much.

any ideas, please?

sorry if this has been covered. it's a busy topic, but i couldn't find anything that quite answered this question.

incidentally, i'm tempted to write a properly subclassable oop version of Extutils::Makemaker with a bit more flexibility about what it writes, and what it makes available to the calling script for subsequent processing, but surely that wheel is lying around somewhere. and mr avery is certainly not neglecting E::M itself. but does anyone perhaps think it's not a stupid idea?


In reply to using Extutils::Makemaker with finished modules by thpfft

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.