- or download this
use File::Temp qw(tempfile);
use Inline 'C';
...
# fileno STDERR: 2
# |foo!|
# ERROR
- or download this
use strict;
use warnings;
...
# here, it outputs:
# ERROR goes to (*(*Perl_IStdIO_ptr(((PerlInterpreter *)Perl_get_conte
+xt())))->pStderr)((*Perl_IStdIO_ptr(((PerlInterpreter *)Perl_get_cont
+ext()))))
- or download this
open my $olderr, '>&STDERR'; # save STDERR
my ($fh, $fn) = tempfile();
...
# |foo!Died at -e line 1.
# |
# ERROR