Help for this page

Select Code to Download


  1. or download this
    $variable=*FILEHANDLE;
    print $variable "things to be printed\n";
    
  2. or download this
    open(OLD_OUT,">&STDOUT");       #save curent STDOUT to OLD_OUT
    open(STDOUT,">/tmp/file.out"); #reassign STDOUT to /tmp/file.out
    close STDOUT ;
    open(STDOUT,">&OLD_OUT");      #restore the previous STDOUT