See Devel::TraceFuncs for one way to do this.

It wouldn't be too hard to write a module, say Devel::TraceMethods that would be used like:

use Module::Name; use Devel::TraceMethods qw( Module::Name );
And would import all function from Module::Name into Devel::TraceMethods::Module::Name and then undef them from Module::Name. Then it would define Module::Name::AUTOLOAD that logged the call and then called the real function Devel::TraceMethods::Module::Name.

You could even make this work in the face of a module that used AUTOLOAD (by having your AUTOLOAD log and then, if needed, call their AUTOLOAD, but then shuffle the new routine into the other namespace when that returns).

Unfortunately, I'm not free to write one at the moment.

Update: The above would break can for this module, so the start-up and AUTOLOAD should build shim routines that log and then call the real routine.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Automatic Debugging by tye
in thread Automatic Debugging by DBX

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.