in reply to Re: debugging /logging help
in thread debugging /logging help

I use an approach along these lines, but break the printing out into a sub...

And I have a question to contribute:
Is there a way to tell on what line your sub was called from? So that I could include the current line number in the sub:

sub mydebug { $msg = shift; print STDERR 'Line '. $linethatcalledme .": $msg\n"; }
I've been inactively looking for this for a while, almost to the point that I'm going to have to start looking for real =)

--Glenn

Replies are listed 'Best First'.
Re: Re: Re: debugging /logging help
by chipmunk (Parson) on Dec 07, 2000 at 21:40 UTC
    Here's a good place to look for real: caller. :)

    Not only can caller tell you where your sub was called from, it can tell you where the sub that called your sub was called from, and so on all the way back to the main code.

      Well, now I know why I couldn't find it! That's just too easy =)
      Thanks for the tip. That will be a real simple addition.

      --Glenn