Help for this page

Select Code to Download


  1. or download this
    {
       # Temporarily undefine STDOUT.
       local *STDOUT;
       func();
    }
    
  2. or download this
    sub func { print("in func\n"); }
    
    ...
       func();
    }
    print("post func\n");
    
  3. or download this
    {
       # Temporarily redirect STDOUT.
       open(local *STDOUT, '>', '/dev/nul');
       func();
    }