Update: The first version of this only looked like it worked. This version really does.
#!/usr/bin/perl use Tie::FileHandle::MultiPlex; open (REALERR, ">&STDERR"); tie *STDERR, Tie::FileHandle::MultiPlex, *A, *REALERR, *B; open(A,'>>','testA') or die "testA: $!\n"; open(B,'>>','testB') or die "testB: $!\n"; warn "test message $$";
This will print out 'test message 2314' or some such to the screen (stderr) as well as appending the same line to files named testA and testB.
I'd still like to learn more about perlio layers, though the need is not as urgent right now; I'd still be interested in a whitepaper-ish thing on perlio layers if anyone knows of one.
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
In reply to Re^2: writing a PerlIO::via module to log stderr?
by DrWhy
in thread writing a PerlIO::via module to log stderr?
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |