Help for this page

Select Code to Download


  1. or download this
    use File::Temp qw(tempfile);
    use Inline 'C';
    ...
    # fileno STDERR: 2
    # |foo!|
    # ERROR
    
  2. 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()))))
    
  3. or download this
    open my $olderr, '>&STDERR'; # save STDERR
    my ($fh, $fn) = tempfile();
    ...
    # |foo!Died at -e line 1.
    # |
    # ERROR