"But when i try to use it in Windows XP, it seems to not understand that it should just add a module to the distro. It creates a new distro instead. I might not have set it up correctly ..."

Please show your .module-starter/config file and the full command you used. Without this, we can't tell if the setup is correct or if you used it correctly. For instance, modules have colons (e.g. --module=Some::Class) whereas distros have a hyphen (e.g. --distro=Some-Class) - perhaps those got mixed up on your commandline.

While I appreciate that your question specifically asks about "adding to an existing module", I'll just point out that you can create multiple modules in a single distribution without using any plugins, e.g.

module-starter --module=My::Example,My::Example::Class --distro=My-Exa +mple

Using the plugin Module::Starter::Smart, I can run

module-starter --module=My::Example

My::Example has boilerplate with author and email (from config). I added a little POD text (to later check this wasn't being overwritten) and ran

module-starter --module=My::Example::Class --distro=My-Example

My::Example was not overwritten and My::Example::Class has boilerplate with author and email (from config).

This appears to cover your "... have all folders and files created, as well as the boilerplates adapted." requirement.

For your specific customisations (e.g. logger code), perhaps consider writing your own plugin. You may find Module::Starter::Plugin and Module::Starter::Plugin::Template to be useful if you choose to do this. Taking a look at the source of existing plugins (e.g. Module::Starter::Smart and Module::Starter::PBP) may also be helpful.

I noticed that Module::Starter::Smart has:

UPDATE: This plugin only covers the simplest use cases. For advanced usage, check out Module::Starter::AddModule.

I'm not familiar with that module - it may be of use to you.

-- Ken


In reply to Re: Adding a class to a module - Can Module::Starter or Dist::Zilla help? by kcott
in thread Adding a class to a module - Can Module::Starter or Dist::Zilla help? by mascip

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.