I posted this question on Stack Overflow a few days ago:
https://stackoverflow.com/questions/64757138/raku-sending-a-string-to-a-subprocesss-standard-input
...but there haven't been any answers, so I'm asking here.
The tl;dr is that I don't see an obvious way to send data to a subprocess's
standard input stream, other than by creating a second subprocess.
For a simple example, suppose I wanted to store a file on a remote host
with ssh:
my $content = 'file contents';
run 'ssh', 'myhost', 'cat > outfile', :in($what-goes-here);
The only solution I've found after a lot of searching is not very appealing.
my $echo = run 'echo', $content, :out;
run 'ssh', 'myhost', 'cat > outfile', :in($echo.out);
Is there any better way?