Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

What I understood you to ask was this: how do I create a distribution so that I can edit my module in place without having to install it? The docs aren't clear, but this is basically how this works. First, edit h2xs and change the $author and $email to your name and email address (otherwise, h2xs will write out spurious information for this and you'll have to edit the results). Then, do this:

  1. h2xs -AX -n Foo::Bar -v .01
  2. Copy your module to
  3. Fill out or, better yet, create a Foo/Bar/t/ directory and create tests there (be sure to update the MANIFEST)
  4. perl
  5. make
  6. make test
  7. make dist

It's the last step that makes a distribution for you!

Also note the -v argument to h2xs. That tells it what your version number is, so that's automatically created for you, if you're filling in the module manually as opposed to copying one that you've already made. You can skip this if you wish.

If, for some reason, your tests do not pass, be sure to run make clean, fix your module (and/or tests) and repeat the above steps, from step 4 (perl Makefile.PL), until the tests pass. If you fail to run make clean, any edits you make to Foo/ will not be picked up.

When you run make test, all tests will be run through the test harness, which will load your module from the blib directory that is created. Thus, there is no need to actually install the module.

Hope this helps.


Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

In reply to Re: MakeMaker, h2xs, and writing CPAN modules by Ovid
in thread MakeMaker, h2xs, and writing CPAN modules by perrin

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, 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, 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (3)
    As of 2020-02-29 04:50 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (128 votes). Check out past polls.