Help for this page

Select Code to Download


  1. or download this
    Though if you try to re-open C<STDOUT> or C<STDERR> as an "in memory"
    file, you have to close it first:
    
        close STDOUT;
        open STDOUT, '>', \$variable or die "Can't open STDOUT: $!";
    
  2. or download this
    # close STDOUT;  # with this it works
    open STDOUT, ">:encoding(cp37)", "foo.out" or die "Cannot redirect STD
    +OUT\n";
    print "yadda yadda\n";