I really dislike what this module is trying to do.

All that can is doing is telling you what will be called if you try to call that method. You're noticing that the imported functions are littering your namespace and providing things to trip over. So you're going to lie about where the pitfalls are.

What I would prefer is a way to import functions and have them not also be methods. Fixing that in Perl is a language issue, so you can't. But second best would be to have a module that allows you to rename what things will be imported as so you can get rid of your conflicts. Whose API might look like this:

# This imports from Module and does the following renamings: # # foo => _foo # bar => _bar # hello => _baz_hello # world => _baz_world # use with_prefix Module => qw(foo bar =_baz_ this that);
(Trick: import into another module then re-export from there to your final module.)

And now you can reposition the obstacle course rather than lying about it.


In reply to Re: Fixing nits with $object->can($method); by tilly
in thread Fixing nits with $object->can($method); by Ovid

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.