The name
If you plan to support only subroutines I don't think it should be called Devel::WrapExports. That name sound more generic and the way I interpret it is that the exporter mechanism will be wrapped to allow me to inspect everything that was exported. I don't know what a better name would be, but the uncommonly long Devel::WrapImportedSubs doesn't seem to bad after all. Imperfect as it may be the concept is clearly communicated. "Devel" - it's to help development; "wrap" - you do something upon each call; "imported" - only imported subroutines are of interest; "subs" - only subroutines are of interest. Note that I suggest "imported" over "exported" because you do it from a caller perspective. The package doing "use Devel::...;</c> later imports from the modules it uses. "Export" makes sense from the module author's perspective (like used as Exporter.pm), e.g. if a module Foo wanted to register every case of use Foo;.

The interface
I think that you have a good interface. However, I think you should open up to other ways of wrapping. Hook::LexWrap is convenient, but it can also break code that relies on caller(). It's possible (and simple) to do a completely transparent pre-hook, so another way to install the hook is quite important.

The implementation
Good luck. I think you'll need it. :-) It's quite a complicated task; there are several tricky cases. I'm looking forward to seeing how you solved it.

lodin


In reply to Re^3: [RFC: Module proposal] Tracing sneaky EXPORTs using wrappers by lodin
in thread [RFC: Module proposal] Tracing sneaky EXPORTs using wrappers by krazyk

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.