Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Get Result Of Exe File Into Another file

Replies are listed 'Best First'.
Re: Get Result Of Exe File Into Another file
by dwm042 (Priest) on Aug 30, 2007 at 14:00 UTC
    As idle has said, if all you want is your output to go to a file, you can use redirection, or perhaps pipe to the 'tee' command. But you can work with the output of a program if you open the program in Perl using a pipe.

    # # note - untested code. # my $filename = "myfile.txt"; open TEXT, "-|", "program textfile" || die("Cannot start program\n"); open OUT, ">", "$filename" || die("Cannot open output file.\n"); while(<TEXT>) { chomp; print OUT "Simon Says \"", $_, "\"\n"; } close(TEXT); close(OUT);
Re: Get Result Of Exe File Into Another file
by idle (Friar) on Aug 30, 2007 at 13:38 UTC
    On unix systems you can simple type: java filename > output.
    However this isn't related to perl.