in reply to STDERR going to string
Your basic problem is that T::BT uses XS code which in turn uses stdio instead of perl IO to print to stderr. Capturing this will become much more problematic, though not necessarily impossible.
There may be modules that can handle this, I'm not sure. However, one for-sure way to do this is to call T::BT in a subprocess, and capture its stderr. Inside a single process, you may be able to set up threads (even Coro threads) or events with a pipe - set up your stderr to a pipe (which is handled by the C library just fine) and have an event listener/thread read it in and append it to your string manually.
I don't think perl can do this by itself with the reference-to-a-scalar trick.
Long term, ask the module author to use perl IO instead of stdio for their output in XS code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: STDERR going to string
by philkime (Beadle) on Oct 03, 2011 at 19:12 UTC | |
|
Re^2: STDERR going to string
by philkime (Beadle) on Oct 10, 2011 at 13:23 UTC | |
by Anonymous Monk on Oct 10, 2011 at 13:38 UTC | |
by philkime (Beadle) on Oct 11, 2011 at 08:21 UTC | |
by Anonymous Monk on Oct 11, 2011 at 09:06 UTC | |
by philkime (Beadle) on Oct 11, 2011 at 09:49 UTC | |
| |
by Anonymous Monk on Oct 12, 2011 at 10:13 UTC |