in reply to Line Numbers

There's probably a way of overloading print (export to CORE::GLOBAL?); there's an example in the mod_perl guide for overloading die. So you may be able to overload print, but maybe not.

But why don't you just write a debug (or trace) function that you can call. The debug function should print out whatever message it's given, but only if the debug flag is set. You could even make it OO, and make the debug flag a member of the Trace object. Or whatever you want to call it. Then you can do whatever you want in the debug method, including printing out numbered messages, and also printing out caller information, if you want.

Replies are listed 'Best First'.
RE: Re: Line Numbers
by Adam (Vicar) on Jul 01, 2000 at 00:40 UTC
    I've used similar techniques in the past, but they are not very satisfying. Additionally, this would require me to locate all my debug statements and upgrade them to the new method. I was hoping to avoid that.