I want to distribute a module that needs to have a lot of tabular data included with it, organized into 6 special data files. The module will use these tables in the form of tied hashes, which means that the text table files distributed with the module need to be compiled into Berkeley DB files (via DB_File).

I have a perl script (to be included in the distro's "bin" directory, and installed along with a couple other executable scripts) that will read the text table files and create the corresponding DB_Files (the whole set of six tables is done in a single run of my "tbl2dbm" -- the data file names are "hardwired").

So, I'd like the "make" step to include running this script to build the DB_Files (which will be needed during "make test"), and then I want "make install" to put the DB_Files into a "standard" location -- presumably in a subdir next to the module's main .pm file in whatever lib path is targeted -- so the module always knows where to find them.

Sad to say, this really is my first dance with ExtUtils::MakeMaker, and I'm at a loss what to put into Makefile.PL to ensure that things go as intended. I know I can put  postamble => ..., as one of the key/value pairs that I pass to WriteMakefile(), but I'm unclear on what sort of thing(s) should be on the RHS there, how those get treated in  sub MY::postable { ... }, and how I access/refer to the various paths for inputs and outputs.

For that matter, I'm a little foggy on how to manage paths within the module itself (and in "tbl2dbm") so that locating the tables, during "make test" and after "make install", is a sure thing. Any ideas, examples and advice would be much appreciated.

(No, I haven't tried anything yet, beyond making sure that MakeMaker succeeds at doing the basic build and install of the module itself, without doing anything about the table data. I don't want the creation and positioning of the DB table files to be a manual, post-installation step, and I'd like to avoid requiring users edit the module or their shell environment to set the table path.)


In reply to Creating a special module install process by graff

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.