in reply to Cheaper - Debug,Log,Errors via Slicing&dicing
I'm not convinced your endeavour is worthwhile, but I did find a problem.
Assuming it works at all, unslice executes too late in
unslice 'SomeModule'; use SomeModule;
It needs to be
BEGIN { unslice 'SomeModule'; } use SomeModule;
A better syntax might be
no slice 'SomeModule'; use SomeModule;
Further more, your slice isn't constant. You might as well remove the prototype. Using the () prototype is not enough to make a constant. The body of the function must also be constant. From perlsub:
Functions with a prototype of () are potential candidates for inlining. If the result after optimization and constant folding is either a constant or a lexically-scoped scalar which has no other references, then it will be used in place of function calls made without &.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Cheaper - Debug,Log,Errors via Slicing&dicing
by rootcho (Pilgrim) on Jul 26, 2007 at 22:00 UTC | |
by ikegami (Patriarch) on Jul 27, 2007 at 14:10 UTC |