Documentation for method bind-stdout assembled from the following pages:

Class: Proc::Async §

From Proc::Async

(Proc::Async) method bind-stdout §

method bind-stdout(IO::Handle:D $handle)

Redirects STDOUT of the target process to a handle (which must be opened). If STDOUT is closed X::Proc::Async::BindOrUse will be thrown.

my $p = Proc::Async.new("ls":out);
my $h = "ls.out".IO.open(:w);
$p.bind-stdout($h);
$p.start;

This program will pipe the output of the ls shell command to a file called ls.out, which we are opened for reading.