Apr 9, 2012, 12:02 PM
Post #6 of 6
The most important step when posting questions is to provide a clear and concise problem statement, which you have not done. However, I do get the basic gist of what you need.
Re: [naven8] How to print output to STDOUT
[In reply to]
You'll want to start by using the caller function to get the context of the current subroutine call.
If you're not already doing so, you'll want to add a Debug flag and base the level of debug output on the value of that flag.
The error output should go to STDERR, not STDOUT.
If you need low level stack trace info, then use one of the Devel modules, such as Devel::StackTrace or Devel:CallerStack.
You may want to use one of the Tee modules that I previously linked to so you can use a single print statement to output the debug data to multiple filehandles.