in reply to Debug Macro
That looks like a good use for a solution with Module::Compile. The original source would be manipulated (via PPI or whatever) and a compiled version with DEBUG() calls replaced by print @_ if 1 would be written as a .pmc files.
The obvious drawback is that once enabled in a program run, the macros won't see runtime changes. But that's coherent with the desire to eliminate the overhead of function calls, since we suppose that the mechanism for recompiling macros at runtime would be as heavy or even worse.
That would make feasible to build constructs that worked for instance like use which is kind of a macro for
BEGIN { require $foo; $foo->import(@args); # if any args }
Hum. May be a good idea or not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Debug Macro
by Outaspace (Scribe) on Mar 27, 2007 at 21:14 UTC | |
by ferreira (Chaplain) on Mar 28, 2007 at 10:28 UTC |