Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    local (*SAVED_STDOUT);
    ...
    open(STDOUT, ">&SAVED_STDOUT");
    
    print "ters\n
    
  2. or download this
    Here is a script that saves, redirects, and
    restores STDOUT and STDERR:
    ...
    
    print STDOUT "stdout 2\n";
    print STDERR "stderr 2\n";