thanks. That helps
Jonathan Scott Duff schreef op 2018-06-20 17:50:
If you don't specify the :out adverb, then the output of the program
you are running will be sent to standard output. Immediately when the
program executes. If you specify the :out adverb, output from the
program will be available for capture via the $proc.out method. A
similar thing applies for standard error.
A way to write the captured output to a file would be something like:
my $proc = run 'echo', 'foo bar baz', :out;
spurt("some-file-name", $proc.out.slurp(:close));
.slurp() will read all of the contents of the handle and return a
string (:close closes the file handle after reading everything).
spurt will write a string to a file.
hope this helps,
-Scott