Help for this page

Select Code to Download


  1. or download this
    use IO::Tee;
    my $tee = IO::Tee -> new(">stdout.txt", \*STDOUT);
    print $tee "Cheese!\n";
    
  2. or download this
    
    my $log = 0;
    ...
    } else {
       print "What did I want to say?\n"
    }
    
  3. or download this
    my $tee;
    sub log_to_file {
    ...
            close $logfile;
        }
    }
    
  4. or download this
    sub log_to_file {
       my $on = $_[0];
    ...
            });
       }
    }