I have a set of modules I had written originally as part of a standalone project, thus they all have root-level package/module names (or hierarchies starting at root level) like "deck" and "player" (it's a blackjack-related project). They refer to each-other, they operate as a system.

Now I've decided to submit the set of modules to CPAN. It's therefore time to move the set of modules from root-level to be sub-levels of my new namespace, Games::Tournament::Blackjack.

( For the record, yes, I did post to modules@perl.org before deciding I'm sure about the name. )

It's not a huge set of modules, surely less than a dozen files, but given the repeatable nature of the task of relocating a set of modules from one common root namespace to a new root namespace, it seems preferable for it to be a job for a perl program or module. I want to make sure to:

1 - rename the files and put them in the appropriate stack of directories
2 - change all cross-references, including fully-qualified variable names referencing other classes
3 - change the package X; declaration
4 - do a fulltext search for the full XX::YY::ZZ of the common original namespace (if any) and replace with the new name, to cover comments.

I realize that I won't be able to cover extreme cases, such as someone eval'ing an expression that builds to the package name..

Any chance this problem has been tackled and documented / encapsulated before?


In reply to Tool to Relocate Module Namespaces by dynamo

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.