Personally, I think explicitly mapping old to new like this is a good thing. I'm a geek, so I'd write something that did it for me. This way you have a single place to look up all the translations, and if you need to tweak one of the parameters, then you can do so easily.

A few years ago, I would have done it via AUTOLOAD. That approach is only going to work when you have known rules for mapping the old way to the new way. Any oddballs would require coding them up explicitly and using AUTOLOAD for the default case. Now days I'd prefer to spell everything out and not worry about any of the corner cases. This is the triumph of true laziness over false laziness.

- doug

BTW: To get the list of things to be translated, write a little script that has  use MyPackage; and then look through the MyPackage symbol table. Run them through a loop (map?) and spit out the default translators. I'd give you the syntax for doing this, but I know that I never get it right the first time or two. I don't have the time to get it right, and I don't want to send you off on a syntactical wild goose chase.


In reply to Re: creating a wrapper module for bacward compatibility by doug
in thread creating a wrapper module for bacward compatibility by gri6507

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.