Help for this page

Select Code to Download


  1. or download this
    my $LOG_FILE = "$HOME/log/test.txt";
    open(LOG, "> $LOG_FILE") || die "Can't redirect stdout";
    ...
          print LOG $line;  
          print $line;
    }
    
  2. or download this
    From: open (CMD, "ls |");
    To:   open (CMD, "ls_non_command |");